Struct finny::decl::FsmStateBuilder
source · [−]pub struct FsmStateBuilder<TFsm, TContext, TState> { /* private fields */ }
Implementations
pub fn on_entry<'a, TAction: Fn(&mut TState, &mut EventContext<'a, TFsm, FsmQueueMock<TFsm>>)>(
&self,
_action: TAction
) -> &Self
pub fn on_entry<'a, TAction: Fn(&mut TState, &mut EventContext<'a, TFsm, FsmQueueMock<TFsm>>)>(
&self,
_action: TAction
) -> &Self
Execute this action when entering the state.
pub fn on_exit<'a, TAction: Fn(&mut TState, &mut EventContext<'a, TFsm, FsmQueueMock<TFsm>>)>(
&self,
_action: TAction
) -> &Self
pub fn on_exit<'a, TAction: Fn(&mut TState, &mut EventContext<'a, TFsm, FsmQueueMock<TFsm>>)>(
&self,
_action: TAction
) -> &Self
Execute this action when exiting the state.
What happens if we receive this event and we are in this state right now?
pub fn on_entry_start_timer<FSetup, FTrigger>(
&self,
_setup: FSetup,
_trigger: FTrigger
) -> FsmStateTimerBuilder<'_, TFsm, TContext, TState> where
FSetup: Fn(&mut TContext, &mut TimerFsmSettings),
FTrigger: Fn(&TContext, &TState) -> Option<<TFsm as FsmBackend>::Events>,
pub fn on_entry_start_timer<FSetup, FTrigger>(
&self,
_setup: FSetup,
_trigger: FTrigger
) -> FsmStateTimerBuilder<'_, TFsm, TContext, TState> where
FSetup: Fn(&mut TContext, &mut TimerFsmSettings),
FTrigger: Fn(&TContext, &TState) -> Option<<TFsm as FsmBackend>::Events>,
Start a new timer when entering this state. The timer should be unit struct with a implemented Default trait. The timer is setup within a closure and the trigger is another closure that returns an event to be enqueued in the FSM.