pub trait Initializer<S: InitialState> {
type Machine: Machine<State = S, Event = NoneEvent>;
// Required method
fn new(state: S) -> Self::Machine;
}
Expand description
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.
Required Associated Types§
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.