My program writes out the current state to a file on every transition. If the program crashes (or needs to be rerun for any other reason) I want to read from the state and initialize the state machine to whatever value is read from the file.
Something like:
let maybe_cached_state: Option<MyState> = read_state_from_file();
if let Some(my_state) = maybe_cached_state {
let host_machine = MyStateMachine::default()
.uninitialized_state_machine()
.init_override(my_state)
.await;
}
Is there a way to do this with the library or would this be a feature request?
My program writes out the current state to a file on every transition. If the program crashes (or needs to be rerun for any other reason) I want to read from the state and initialize the state machine to whatever value is read from the file.
Something like:
Is there a way to do this with the library or would this be a feature request?