[−][src]Trait sm::Machine
Machine provides the method required to query a state machine for its current state.
If you are using the sm!
macro, then there is no need to interact with
this trait.
Associated Types
type State: State
State represents the current (static) state of the state machine.
type Event: Event
Event represents the (optional) event that resulted in the current state of the machine.
Required Methods
fn state(&self) -> Self::State
state allows you to query the current state of the state machine.
fn trigger(&self) -> Option<Self::Event>
trigger allows you to query the event that triggered the current state of the machine.
This returns an Option
, which is None
if the machine is in its
initial state, caused by initialisation, not by an even-based
transition.