Struct ralf::StateMachine [] [src]

pub struct StateMachine<'a, T> where
    T: 'a + Copy + Clone
{ /* fields omitted */ }

State machine with a state of type T

Methods

impl<'a, T> StateMachine<'a, T> where
    T: 'a + Copy + Clone
[src]

[src]

Create a new state machine from an initial state Note: The returned machine will be empty, so actions won't have any effects until reducers are added.

[src]

Add a reducer to the state machine

[src]

Action processing logic, generate the new state from (prev_state, action) and set the internal state to the new state.

[src]

Recover a copy of the state

Warning

This method will clone the entire state, and is therefore potentially expensive

Trait Implementations

impl<'a, T> Debug for StateMachine<'a, T> where
    T: 'a + Copy + Clone
[src]

[src]

Formats the value using the given formatter. Read more

impl<'a, T> Display for StateMachine<'a, T> where
    T: 'a + Copy + Clone
[src]

[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl<'a, T> !Send for StateMachine<'a, T>

impl<'a, T> !Sync for StateMachine<'a, T>