pub trait StateMachine<S, E> {
// Required methods
fn move_to(&mut self, state: S) -> Result<(), E>;
fn can_move_to(&self, state: &S) -> Result<(), E>;
}Expand description
A generic state machine
Required Methods§
Sourcefn move_to(&mut self, state: S) -> Result<(), E>
fn move_to(&mut self, state: S) -> Result<(), E>
Attempt to move the state machine to a new state
Sourcefn can_move_to(&self, state: &S) -> Result<(), E>
fn can_move_to(&self, state: &S) -> Result<(), E>
Check if the state machine can move to a new state