[−][src]Struct sana_core::automata::Automata
Finite state automata
Fields
states: Vec<State<T>>
edges: BTreeMap<(usize, CharRange), usize>
Implementations
impl<T> Automata<T>
[src]
pub fn get(&self, ix: usize) -> Option<&State<T>>
[src]
Get a state by index
pub fn insert_state(&mut self, state: State<T>)
[src]
Insert state into the automata
pub fn insert_edge(&mut self, from: usize, to: usize, range: CharRange)
[src]
Insert transition from state with index from
to state with index
to
with the character range range
pub fn transitions_from(
&self,
state: usize
) -> impl Iterator<Item = (&CharRange, usize)>
[src]
&self,
state: usize
) -> impl Iterator<Item = (&CharRange, usize)>
An iterator of all transitions from the given state
pub fn transite(&self, state: usize, ch: char) -> Option<usize>
[src]
Follow a transition from the given state that by the given char
pub fn find_terminal_node(&self) -> usize
[src]
Find the terminal node of the automata
pub fn node_kinds(&self) -> Vec<NodeKind>
[src]
Return a list of node kinds of the automata states
The indices of kinds in the list match the indices of corresponding states in the automata
Trait Implementations
Auto Trait Implementations
impl<T> RefUnwindSafe for Automata<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for Automata<T> where
T: Send,
T: Send,
impl<T> Sync for Automata<T> where
T: Sync,
T: Sync,
impl<T> Unpin for Automata<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for Automata<T> where
T: UnwindSafe,
T: 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,
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> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
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.
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>,