[−][src]Struct automafish::StateMachine
A compiled state machine.
The StateMachine
can be created with the Builder
.
Implementations
impl<TCriteria, TAction> StateMachine<TCriteria, TAction> where
TCriteria: Criteria,
[src]
TCriteria: Criteria,
pub fn start(&self) -> MachineState
[src]
Acquires the initial state of the state machine.
pub fn step(
&self,
current: MachineState,
input: &TCriteria::Input
) -> MachineState
[src]
&self,
current: MachineState,
input: &TCriteria::Input
) -> MachineState
Performs a step from the current
machine state with the given input
.
impl<TCriteria, TAction> StateMachine<TCriteria, TAction> where
TAction: Action,
[src]
TAction: Action,
pub fn execute(&self, current: MachineState, input: &mut TAction::Input)
[src]
Executes the actions of the current
state with the given input
.
Use Self::execute_mut
if the current TAction
is an ActionMut
.
impl<TCriteria, TAction> StateMachine<TCriteria, TAction> where
TAction: ActionMut,
[src]
TAction: ActionMut,
pub fn execute_mut(&mut self, current: MachineState, input: &mut TAction::Input)
[src]
Executes the actions of the current
state with the given input
.
Use Self::execute
if the current TAction
is an Action
.
impl<TCriteria, TAction> StateMachine<TCriteria, TAction> where
TAction: Action,
TCriteria: Criteria<Input = TAction::Input>,
[src]
TAction: Action,
TCriteria: Criteria<Input = TAction::Input>,
pub fn step_and_execute(
&self,
current: MachineState,
input: &mut TAction::Input
) -> MachineState
[src]
&self,
current: MachineState,
input: &mut TAction::Input
) -> MachineState
Performs a step from the current state
and executes any actions based on the new state.
This method is available only if the TCriteria
and TAction
have the same Input
type
and is equivalent to:
let next_state = machine.step(current_state, &input); machine.execute(current_state, &mut input);
impl<TCriteria, TAction> StateMachine<TCriteria, TAction> where
TAction: ActionMut,
TCriteria: Criteria<Input = TAction::Input>,
[src]
TAction: ActionMut,
TCriteria: Criteria<Input = TAction::Input>,
pub fn step_and_execute_mut(
&mut self,
current: MachineState,
input: &mut TAction::Input
) -> MachineState
[src]
&mut self,
current: MachineState,
input: &mut TAction::Input
) -> MachineState
Performs a step from the current state
and executes any actions based on the new state.
This method is available only if the TCriteria
and TAction
have the same Input
type
and is equivalent to:
let next_state = machine.step(current_state, &input); machine.execute_mut(current_state, &mut input);
Trait Implementations
impl<TCriteria: Debug, TAction: Debug> Debug for StateMachine<TCriteria, TAction>
[src]
Auto Trait Implementations
impl<TCriteria, TAction> RefUnwindSafe for StateMachine<TCriteria, TAction> where
TAction: RefUnwindSafe,
TCriteria: RefUnwindSafe,
TAction: RefUnwindSafe,
TCriteria: RefUnwindSafe,
impl<TCriteria, TAction> Send for StateMachine<TCriteria, TAction> where
TAction: Send,
TCriteria: Send,
TAction: Send,
TCriteria: Send,
impl<TCriteria, TAction> Sync for StateMachine<TCriteria, TAction> where
TAction: Sync,
TCriteria: Sync,
TAction: Sync,
TCriteria: Sync,
impl<TCriteria, TAction> Unpin for StateMachine<TCriteria, TAction> where
TAction: Unpin,
TCriteria: Unpin,
TAction: Unpin,
TCriteria: Unpin,
impl<TCriteria, TAction> UnwindSafe for StateMachine<TCriteria, TAction> where
TAction: UnwindSafe,
TCriteria: UnwindSafe,
TAction: UnwindSafe,
TCriteria: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,