[−][src]Struct fsm_rust_jb::fsm::FSM
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]
State: Eq + PartialEq + Copy + Hash + Debug,
Effect: Eq + PartialEq + Copy,
pub fn new<'a>(
initial_state: State,
transition_table: HashMap<State, Vec<Transition<State, Effect>>>
) -> Result<Self, FSMError<'a, State>>[src]
initial_state: State,
transition_table: HashMap<State, Vec<Transition<State, Effect>>>
) -> Result<Self, FSMError<'a, State>>
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]
&self,
string: &'a String,
mut effector: Option<&'a mut dyn Effector<Effect>>
) -> Result<(), FSMError<'a, State>>
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]
Effect: RefUnwindSafe,
State: RefUnwindSafe,
impl<State, Effect> Send for FSM<State, Effect> where
Effect: Send,
State: Send, [src]
Effect: Send,
State: Send,
impl<State, Effect> Sync for FSM<State, Effect> where
Effect: Sync,
State: Sync, [src]
Effect: Sync,
State: Sync,
impl<State, Effect> Unpin for FSM<State, Effect> where
Effect: Unpin,
State: Unpin, [src]
Effect: Unpin,
State: Unpin,
impl<State, Effect> UnwindSafe for FSM<State, Effect> where
Effect: UnwindSafe,
State: UnwindSafe, [src]
Effect: UnwindSafe,
State: 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>,