pub trait StateMachineExt<K>: StateMachine<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§
Sourcefn create_tree(&self, ctx: &SmContext<K>)
fn create_tree(&self, ctx: &SmContext<K>)
NOTE [StateMachineExt::new] is created without a hierarchy
fn fail(&self, ctx: &SmContext<K>) -> Option<StateId<K>>
fn complete(&self, ctx: &SmContext<K>) -> Option<StateId<K>>
Sourcefn update_state_and_signal(
&self,
ctx: &SmContext<K>,
state: K::State,
) -> Option<StateId<K>>
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.
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>)
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.