pub struct Dfa {
pub states: Vec<State>,
pub composition_to_state: HashMap<Box<[Transformation]>, u32>,
}Expand description
The DFA (Deterministic Finite Automaton) core that manages states and transitions.
This DFA supports a Lazy JIT mechanism, allowing the Engine to learn new states during execution to optimize performance.
Fields§
§states: Vec<State>List of states in the DFA.
composition_to_state: HashMap<Box<[Transformation]>, u32>Hash map mapping transformation stacks to state IDs to avoid duplicates.
Implementations§
Source§impl Dfa
impl Dfa
Sourcepub fn add_state(&mut self, composition: &[Transformation]) -> u32
pub fn add_state(&mut self, composition: &[Transformation]) -> u32
Adds a new state to the DFA from a transformation stack. If the state already exists, it returns the existing state ID.
Sourcepub fn find_state(&self, composition: &[Transformation]) -> Option<u32>
pub fn find_state(&self, composition: &[Transformation]) -> Option<u32>
Finds the state ID corresponding to a transformation stack.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Dfa
impl RefUnwindSafe for Dfa
impl Send for Dfa
impl Sync for Dfa
impl Unpin for Dfa
impl UnsafeUnpin for Dfa
impl UnwindSafe for Dfa
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more