Trait rex::manager::StateMachine
source · pub trait StateMachine<K>: Send + Syncwhere
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…
- optionally emits
Signals - consumed by theStateMachineManagersignal_queue - optionally emits
Notifications - consumed by the [NotificationQueue]