Trait rex::manager::StateMachineExt
source · pub trait StateMachineExt<K>: StateMachine<K>{
// Provided methods
fn create_tree(&self, ctx: &SmContext<K>, id: StateId<K>) { ... }
fn has_state(&self, ctx: &SmContext<K>, id: StateId<K>) -> bool { ... }
fn fail(&self, ctx: &SmContext<K>, id: StateId<K>) -> Option<StateId<K>> { ... }
fn complete(&self, ctx: &SmContext<K>, id: StateId<K>) -> Option<StateId<K>> { ... }
fn terminal_state(state: K::State) -> bool { ... }
fn update_state_and_signal(
&self,
ctx: &SmContext<K>,
id: StateId<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>,
id: StateId<K>,
duration: Duration
) -> Result<(), SendError<Notification<K::Message>>> { ... }
fn set_timeout_millis(
&self,
ctx: &SmContext<K>,
id: StateId<K>,
millis: u64
) -> Result<(), SendError<Notification<K::Message>>> { ... }
fn cancel_timeout(
&self,
ctx: &SmContext<K>,
id: StateId<K>
) -> Result<(), SendError<Notification<K::Message>>> { ... }
fn get_parent_id(
&self,
ctx: &SmContext<K>,
id: StateId<K>
) -> Option<StateId<K>> { ... }
}Provided Methods§
sourcefn create_tree(&self, ctx: &SmContext<K>, id: StateId<K>)
fn create_tree(&self, ctx: &SmContext<K>, id: StateId<K>)
NOTE [StateMachineExt::new] is created without a hierarchy
fn has_state(&self, ctx: &SmContext<K>, id: StateId<K>) -> bool
fn fail(&self, ctx: &SmContext<K>, id: StateId<K>) -> Option<StateId<K>>
fn complete(&self, ctx: &SmContext<K>, id: StateId<K>) -> Option<StateId<K>>
sourcefn terminal_state(state: K::State) -> bool
fn terminal_state(state: K::State) -> bool
represents a state that will no longer change
sourcefn update_state_and_signal(
&self,
ctx: &SmContext<K>,
id: StateId<K>,
state: K::State
) -> Option<StateId<K>>
fn update_state_and_signal( &self, ctx: &SmContext<K>, id: StateId<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>, id: StateId<K>, duration: Duration ) -> Result<(), SendError<Notification<K::Message>>>
fn set_timeout_millis( &self, ctx: &SmContext<K>, id: StateId<K>, millis: u64 ) -> Result<(), SendError<Notification<K::Message>>>
fn cancel_timeout( &self, ctx: &SmContext<K>, id: StateId<K> ) -> Result<(), SendError<Notification<K::Message>>>
fn get_parent_id( &self, ctx: &SmContext<K>, id: StateId<K> ) -> Option<StateId<K>>
Object Safety§
This trait is not object safe.