pub trait StateMachine {
type State;
// Required methods
fn state(&self) -> Self::State;
fn transition(&self, state: Self::State) -> Context;
}Expand description
Denotes a type which represents a state machine.
Required Associated Types§
Required Methods§
Sourcefn transition(&self, state: Self::State) -> Context
fn transition(&self, state: Self::State) -> Context
Transitions the state machine to a new state.
Returns the context in which the new state is running.