Struct peepmatic_automata::Automaton [−][src]
pub struct Automaton<TAlphabet, TState, TOutput> where
TAlphabet: Clone + Eq + Hash + Ord,
TState: Clone + Eq + Hash,
TOutput: Output, { /* fields omitted */ }
Expand description
A finite-state transducer automata.
These are constructed via Builder
.
An Automaton
is immutable: new entries cannot be inserted and existing
entries cannot be removed.
To query an Automaton
, there are two APIs:
-
get
– a high-level method to get the associated output value of a full input sequence. -
query
– a low-level method to incrementally query the automata. It does not require that you have the full input sequence on hand all at once, only the next character. It also allows you to process the output as it it built up, rather than only at giving you the final, complete output value.
Implementations
pub fn get<'a>(
&self,
input: impl IntoIterator<Item = &'a TAlphabet>
) -> Option<TOutput> where
TAlphabet: 'a,
pub fn get<'a>(
&self,
input: impl IntoIterator<Item = &'a TAlphabet>
) -> Option<TOutput> where
TAlphabet: 'a,
Get the output value associated with the given input sequence.
Returns None
if the input sequence is not a member of this
Automaton
’s keys. Otherwise, returns Some(output)
.
Trait Implementations
Auto Trait Implementations
impl<TAlphabet, TState, TOutput> RefUnwindSafe for Automaton<TAlphabet, TState, TOutput> where
TAlphabet: RefUnwindSafe,
TOutput: RefUnwindSafe,
TState: RefUnwindSafe,
impl<TAlphabet, TState, TOutput> Send for Automaton<TAlphabet, TState, TOutput> where
TAlphabet: Send,
TOutput: Send,
TState: Send,
impl<TAlphabet, TState, TOutput> Sync for Automaton<TAlphabet, TState, TOutput> where
TAlphabet: Sync,
TOutput: Sync,
TState: Sync,
impl<TAlphabet, TState, TOutput> Unpin for Automaton<TAlphabet, TState, TOutput> where
TState: Unpin,
impl<TAlphabet, TState, TOutput> UnwindSafe for Automaton<TAlphabet, TState, TOutput> where
TAlphabet: RefUnwindSafe,
TOutput: RefUnwindSafe,
TState: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more