[][src]Struct fsm_rust_jb::fsm::FSM

pub struct FSM<State, Effect> where
    State: Eq + PartialEq + Copy + Hash,
    Effect: Eq + PartialEq + Copy
{ /* fields omitted */ }

Finite state machine with side effects (Mealy automata)

Implementations

impl<State, Effect> FSM<State, Effect> where
    State: Eq + PartialEq + Copy + Hash + Debug,
    Effect: Eq + PartialEq + Copy
[src]

pub fn new<'a>(
    initial_state: State,
    transition_table: HashMap<State, Vec<Transition<State, Effect>>>
) -> Result<Self, FSMError<'a, State>>
[src]

Creates new instance of FSM

  • initial_state: starting state,
  • transition_table: transition graph

pub fn proceed<'a>(
    &self,
    string: &'a String,
    mut effector: Option<&'a mut dyn Effector<Effect>>
) -> Result<(), FSMError<'a, State>>
[src]

Runs some string through FSM to validate it (and apply some effects)

  • string: runnable string,
  • effector: module that mutates some data by effects

Auto Trait Implementations

impl<State, Effect> RefUnwindSafe for FSM<State, Effect> where
    Effect: RefUnwindSafe,
    State: RefUnwindSafe
[src]

impl<State, Effect> Send for FSM<State, Effect> where
    Effect: Send,
    State: Send
[src]

impl<State, Effect> Sync for FSM<State, Effect> where
    Effect: Sync,
    State: Sync
[src]

impl<State, Effect> Unpin for FSM<State, Effect> where
    Effect: Unpin,
    State: Unpin
[src]

impl<State, Effect> UnwindSafe for FSM<State, Effect> where
    Effect: UnwindSafe,
    State: UnwindSafe
[src]

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, 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.