[−][src]Trait automafish::Action
Action that may be executed when entering a state.
See ActionMut
if you need an action that may mutate its internal state. The Action
is
implemented for Box<Fn(T)>
by default.
Associated Types
type Input
Input type for the action.
Required methods
pub fn execute(&self, input: &mut Self::Input)
Perform the action in the input.
Note that the input
takes the input type as a reference to allow multiple actions to be
executed on it if necessary. This doesn't prevent mutating the input though, since the
Input
itself can be defined as &mut Foo
.
Examples
struct IncrementValue; impl Action for IncrementValue { type Input = u32; fn execute(&self, input: &mut Self::Input) { *input += 1; } }