pub trait Transition<E: Event>: Debug {
type Machine: Machine;
// Required method
fn transition(self, event: E) -> Self::Machine;
}
Expand description
Transition provides the method required to transition from one state to another.
If you are using the sm!
macro, then there is no need to interact with
this trait.
Required Associated Types§
Required Methods§
Sourcefn transition(self, event: E) -> Self::Machine
fn transition(self, event: E) -> Self::Machine
transition consumes the state machine and returns a new machine in the correct state, based on the passed in event.