Trait email_parser::fsm::FSM
source · pub trait FSM<S> {
type Symbol;
// Required methods
fn transition(state: S, symbol: Self::Symbol) -> S;
fn is_final(state: &S) -> bool;
fn start() -> S;
}
Expand description
FSM is an abstraction over behavior of deterministic finite automata. A DFA has a set of states (generic type S) and alphabets (all possible symbols). One of them is a start state (start fn). A transition takes the DFA from one state to other by consuming a symbol. If the input is completely consumed and DFA is in a final state (or accepting state) then we say that the input belongs to the language accepted by the DFA.