Trait dirty_fsm::Action [−][src]
pub trait Action<S, E, Context>: Debug {
fn on_register(&mut self) -> Result<(), E>;
fn on_first_run(&mut self, context: &Context) -> Result<(), E>;
fn execute(
&mut self,
delta: &Duration,
context: &Context
) -> Result<ActionFlag<S>, E>;
fn on_finish(&mut self, interrupted: bool) -> Result<(), E>;
}
Expand description
Defines an executable action.
This trait is to be implemented by anything that shall be run by a StateMachine
.
Required methods
fn on_register(&mut self) -> Result<(), E>
fn on_register(&mut self) -> Result<(), E>
Called once when the action is registered with its parent StateMachine
.
fn on_first_run(&mut self, context: &Context) -> Result<(), E>
fn on_first_run(&mut self, context: &Context) -> Result<(), E>
Called once each time this action is switched to from another state
Called on every state machine iteration while this action’s state is active