Trait Transition

Source
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§

Source

type Machine: Machine

Machine represents the machine on which the implemented transformation should execute.

Required Methods§

Source

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.

Implementors§