Struct dfa::Automaton

source ·
pub struct Automaton<T>where
    T: Eq,
{ /* private fields */ }

Implementations§

Creates a new automaton with 1 state and no edges.

Adds a state in the automaton and return it’s StateIndex.

Adds an edge to the automaton, requires the starting state, the ending state and a value of type T representing the transition value.

Sets the starting state of the automaton.

Adds an accepting state to the automaton.

Consumes a value and advances, if the value is not present in some transition then it stays in the same state.

Restarts the automaton, setting the current state to start.

Returns a boolean value telling if the current state is an accepting state.

Returns StateIndex of the current value.

Trait Implementations§

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.