[][src]Trait sm::Initializer

pub trait Initializer<S: InitialState> {
    type Machine: Machine<State = S, Event = NoneEvent>;
    fn new(state: S) -> Self::Machine;
}

Initializer defines the new method on a machine, that accepts any state marked as InitialState, and returns a new machine.

If you are using the sm! macro, then there is no need to interact with this trait.

Associated Types

type Machine: Machine<State = S, Event = NoneEvent>

Machine represents the machine which the implemented initialiser should return.

Loading content...

Required methods

fn new(state: S) -> Self::Machine

new initialises a new machine, based on the provided InitialState as input.

Loading content...

Implementors

Loading content...