[−][src]Struct fsm_rust_jb::types::Transition
Transition to next state which is validated by condition
Fields
condition: Option<Predicate>
Predicate that validates current character of stream. If None then transition is unconditional (i.e. succeeds for every input character)
to: State
Next state
effect: Option<Effect>
Side effect that is generated after successful validation of transition If None then no effect is generated
Implementations
impl<State, Effect> Transition<State, Effect> where
State: Eq + PartialEq + Copy,
Effect: Copy,
[src]
State: Eq + PartialEq + Copy,
Effect: Copy,
pub fn new(
to: State,
condition: Option<Predicate>,
effect: Option<Effect>
) -> Self
[src]
to: State,
condition: Option<Predicate>,
effect: Option<Effect>
) -> Self
Creates new transition
- to: next state,
- condition: predicate for character,
- effect: side effect
pub fn transit(&self, ch: char) -> (Option<State>, Option<Effect>)
[src]
Matches next state and side effect for current character
- ch: current character (of stream)
Auto Trait Implementations
impl<State, Effect> RefUnwindSafe for Transition<State, Effect> where
Effect: RefUnwindSafe,
State: RefUnwindSafe,
[src]
Effect: RefUnwindSafe,
State: RefUnwindSafe,
impl<State, Effect> Send for Transition<State, Effect> where
Effect: Send,
State: Send,
[src]
Effect: Send,
State: Send,
impl<State, Effect> Sync for Transition<State, Effect> where
Effect: Sync,
State: Sync,
[src]
Effect: Sync,
State: Sync,
impl<State, Effect> Unpin for Transition<State, Effect> where
Effect: Unpin,
State: Unpin,
[src]
Effect: Unpin,
State: Unpin,
impl<State, Effect> UnwindSafe for Transition<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>,