[][src]Struct stateright::QuickMachine

pub struct QuickMachine<State, Action> {
    pub init_states: fn() -> Vec<State>,
    pub actions: fn(_: &State, _: &mut Vec<Action>),
    pub next_state: fn(_: &State, _: &Action) -> Option<State>,
}

A convenience structure for succinctly describing a throwaway StateMachine.

Fields

init_states: fn() -> Vec<State>

Returns the initial possible states.

actions: fn(_: &State, _: &mut Vec<Action>)

Collects the subsequent possible actions based on a previous state.

next_state: fn(_: &State, _: &Action) -> Option<State>

Converts a previous state and action to a resulting state. None indicates that the action does not change the state.

Trait Implementations

impl<State: Clone, Action: Clone> Clone for QuickMachine<State, Action>[src]

impl<State, Action> StateMachine for QuickMachine<State, Action>[src]

type State = State

The type of state upon which this machine operates.

type Action = Action

The type of action that transitions between states.

Auto Trait Implementations

impl<State, Action> RefUnwindSafe for QuickMachine<State, Action>

impl<State, Action> Send for QuickMachine<State, Action>

impl<State, Action> Sync for QuickMachine<State, Action>

impl<State, Action> Unpin for QuickMachine<State, Action>

impl<State, Action> UnwindSafe for QuickMachine<State, Action>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,