Trait rex::manager::StateMachine

source ·
pub trait StateMachine<K>: Send + Sync
where K: Rex,
{ // Required methods fn process<'life0, 'async_trait>( &'life0 self, ctx: SmContext<K>, id: StateId<K>, input: K::Input ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_kind(&self) -> K; // Provided methods fn get_state(&self, ctx: &SmContext<K>, id: StateId<K>) -> Option<K::State> { ... } fn get_tree( &self, ctx: &SmContext<K>, id: StateId<K> ) -> Option<Arc<FairMutex<Node<StateId<K>, <K as Kind>::State>>>> { ... } fn new_child( &self, ctx: &SmContext<K>, id: StateId<K>, parent_id: StateId<K> ) { ... } fn update(&self, ctx: &SmContext<K>, id: StateId<K>, state: K::State) { ... } }
Expand description

Represents the trait that a state machine must fulfill to process signals A StateMachine consumes the input portion of a Signal and…

Required Methods§

source

fn process<'life0, 'async_trait>( &'life0 self, ctx: SmContext<K>, id: StateId<K>, input: K::Input ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source

fn get_kind(&self) -> K

Provided Methods§

source

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

source

fn get_tree( &self, ctx: &SmContext<K>, id: StateId<K> ) -> Option<Arc<FairMutex<Node<StateId<K>, <K as Kind>::State>>>>

source

fn new_child(&self, ctx: &SmContext<K>, id: StateId<K>, parent_id: StateId<K>)

source

fn update(&self, ctx: &SmContext<K>, id: StateId<K>, state: K::State)

Implementors§