Struct finny::decl::FsmSubMachineBuilder
source · [−]pub struct FsmSubMachineBuilder<TFsm, TContext, TSubMachine> { /* private fields */ }
Implementations
impl<TFsm, TContext, TSubMachine> FsmSubMachineBuilder<TFsm, TContext, TSubMachine> where
TFsm: FsmBackend<Context = TContext>,
TSubMachine: FsmBackend,
impl<TFsm, TContext, TSubMachine> FsmSubMachineBuilder<TFsm, TContext, TSubMachine> where
TFsm: FsmBackend<Context = TContext>,
TSubMachine: FsmBackend,
pub fn with_context<TCtxFactory: Fn(&TContext) -> <TSubMachine as FsmBackend>::Context>(
&mut self,
_sub_context_factory: TCtxFactory
) -> &Self
pub fn with_context<TCtxFactory: Fn(&TContext) -> <TSubMachine as FsmBackend>::Context>(
&mut self,
_sub_context_factory: TCtxFactory
) -> &Self
Adds a context adapter. A referenced context of the parent machine is provided, and a new instance of the submachine’s context has to be instantiated.
pub fn on_entry<'a, TAction: Fn(&mut TSubMachine, &mut EventContext<'a, TFsm, FsmQueueMock<TFsm>>)>(
&self,
_action: TAction
) -> &Self
pub fn on_entry<'a, TAction: Fn(&mut TSubMachine, &mut EventContext<'a, TFsm, FsmQueueMock<TFsm>>)>(
&self,
_action: TAction
) -> &Self
Execute this action when entering the sub-machine state.
pub fn on_exit<'a, TAction: Fn(&mut TSubMachine, &mut EventContext<'a, TFsm, FsmQueueMock<TFsm>>)>(
&self,
_action: TAction
) -> &Self
pub fn on_exit<'a, TAction: Fn(&mut TSubMachine, &mut EventContext<'a, TFsm, FsmQueueMock<TFsm>>)>(
&self,
_action: TAction
) -> &Self
Execute this action when exiting the sub-machine state.
pub fn on_event<TEvent>(
&self
) -> FsmEventBuilderState<'_, TFsm, TContext, TEvent, TSubMachine>
pub fn on_event<TEvent>(
&self
) -> FsmEventBuilderState<'_, TFsm, TContext, TEvent, TSubMachine>
What happens if we receive this event and we are in this submachine’s state right now?