IsState

Trait IsState 

Source
pub trait IsState<State>: StateMachine {
    // Required method
    fn is_state(&self) -> bool;
}
Expand description

An implementation of this trait will be generated for every state. This is can be used to test if the state machine is in a desired state.

Required Methods§

Source

fn is_state(&self) -> bool

The method must be called with the turbo fish syntax as otherwise Rust cannot figure out which implementation to call. To check if the state machine is in a given state call:

let is_in_state: bool = IsState::<State>::is_state(&sfsm);

Implementors§