Skip to content

*StateMachine Conversion #44

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
christianheussy opened this issue Jan 21, 2025 · 0 comments
Open

*StateMachine Conversion #44

christianheussy opened this issue Jan 21, 2025 · 0 comments

Comments

@christianheussy
Copy link
Contributor

Current Limitation

Statig currently defines three types of state machines:

  • UnInitializedStateMachine
  • InitializedStateMachine
  • StateMachine - This type employs lazy initialized.

Deserialization yields an UninitializedStateMachine, which can subsequently be transformed into an InitializedStateMachine via the init method. However, the StateMachine type, being lazily initialized, is predominantly used throughout the codebase and offers better readability. It would be beneficial to provide direct conversion methods to StateMachine from the other two types.

Proposed Solution

Implement the following conversions:

  • From<InitializedStateMachine> for StateMachine
  • From<UnInitializedStateMachine> for StateMachine
    • In this case, the initialized field within StateMachine should be set to false.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant