StateMachineExt

Trait StateMachineExt 

Source
pub trait StateMachineExt<K>: StateMachine<K>
where K: Rex, K::Message: TimeoutMessage<K>,
{ // Provided methods fn create_tree(&self, ctx: &SmContext<K>) { ... } fn fail(&self, ctx: &SmContext<K>) -> Option<StateId<K>> { ... } fn complete(&self, ctx: &SmContext<K>) -> Option<StateId<K>> { ... } fn update_state_and_signal( &self, ctx: &SmContext<K>, state: K::State, ) -> Option<StateId<K>> { ... } fn notify(&self, ctx: &SmContext<K>, msg: impl Into<K::Message>) { ... } fn set_timeout(&self, ctx: &SmContext<K>, duration: Duration) { ... } fn return_in( &self, ctx: &SmContext<K>, item: RetainItem<K>, duration: Duration, ) { ... } fn cancel_timeout(&self, ctx: &SmContext<K>) { ... } }

Provided Methods§

Source

fn create_tree(&self, ctx: &SmContext<K>)

NOTE [StateMachineExt::new] is created without a hierarchy

Source

fn fail(&self, ctx: &SmContext<K>) -> Option<StateId<K>>

Source

fn complete(&self, ctx: &SmContext<K>) -> Option<StateId<K>>

Source

fn update_state_and_signal( &self, ctx: &SmContext<K>, state: K::State, ) -> Option<StateId<K>>

update state is meant to be used to signal a parent state of a child state if a parent exists, this function makes no assumptions of the potential structure of a state hierarchy and should be just as performant on a single state tree as it is for multiple states. Returns the parent’s StateId if there was one.

Source

fn notify(&self, ctx: &SmContext<K>, msg: impl Into<K::Message>)

Source

fn set_timeout(&self, ctx: &SmContext<K>, duration: Duration)

Source

fn return_in(&self, ctx: &SmContext<K>, item: RetainItem<K>, duration: Duration)

Source

fn cancel_timeout(&self, ctx: &SmContext<K>)

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§

Source§

impl<K, T> StateMachineExt<K> for T
where T: StateMachine<K>, K: Rex, K::Message: TimeoutMessage<K>,