State

Trait State 

Source
pub trait State<Engine> {
    // Required methods
    fn toggle(engine: &mut Engine, inner: Option<&Self>) -> bool;
    fn load(engine: &mut Engine) -> Self;
    fn run(&mut self, engine: &mut Engine);
    fn drop(&mut self, engine: &mut Engine);
}

Required Methods§

Source

fn toggle(engine: &mut Engine, inner: Option<&Self>) -> bool

This determines whether or not to run this local state machine.

Source

fn load(engine: &mut Engine) -> Self

This creates and imports new initial state on this local state machine when the toggle’s on.

Source

fn run(&mut self, engine: &mut Engine)

This executes custom logics and manipulates this local state machine’s states.

Source

fn drop(&mut self, engine: &mut Engine)

When the toggle’s off … After then, the sub states[i.e) StateBar and StateBar2] will be droped automatically.

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.

Implementors§