pub trait State<Σ: Eq + Hash + Copy> {
type Index;
// Required methods
fn get_transition(&self, symbol: Self::Index) -> Option<&Self>;
fn add_transition(&mut self, transition: (Σ, Option<&Self>));
fn set_accept(&mut self, accept: bool);
fn is_accept(&self) -> bool;
}Expand description
A node in the DFA, contains is_accept and a transition hashmap. MARK: State
Required Associated Types§
Required Methods§
Sourcefn get_transition(&self, symbol: Self::Index) -> Option<&Self>
fn get_transition(&self, symbol: Self::Index) -> Option<&Self>
Returns the next state given the provided symbol, if it exists.
Sourcefn add_transition(&mut self, transition: (Σ, Option<&Self>))
fn add_transition(&mut self, transition: (Σ, Option<&Self>))
Adds a transition to the hashmap. None represents a self-transition.
Sourcefn set_accept(&mut self, accept: bool)
fn set_accept(&mut self, accept: bool)
Sets the accept state flag.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".