pub struct Dfa { /* private fields */ }Expand description
Lazy DFA for fast exact matching.
Implementations§
Source§impl Dfa
impl Dfa
Sourcepub fn from_nfa(
nfa: &Nfa,
bridge: Option<&FuzzyBridge>,
case_insensitive: bool,
multi_line: bool,
) -> Option<Self>
pub fn from_nfa( nfa: &Nfa, bridge: Option<&FuzzyBridge>, case_insensitive: bool, multi_line: bool, ) -> Option<Self>
Create a new DFA from an NFA. Returns None if the NFA contains states that can’t be converted to DFA (fuzzy matching with edits, lookahead/lookbehind, backreferences).
If bridge is provided, exact FuzzyLiteral states will be expanded.
If case_insensitive is true, matching will be case-insensitive.
If multi_line is true, ^ and $ will match at line boundaries.
Sourcepub fn find_n(&mut self, text: &str, n: usize) -> Vec<DfaMatch>
pub fn find_n(&mut self, text: &str, n: usize) -> Vec<DfaMatch>
Find the first n non-overlapping matches.
Sourcepub fn is_anchored_start(&self) -> bool
pub fn is_anchored_start(&self) -> bool
Check if the DFA is anchored at start.
Sourcepub fn is_anchored_end(&self) -> bool
pub fn is_anchored_end(&self) -> bool
Check if the DFA is anchored at end.
Sourcepub fn state_count(&self) -> usize
pub fn state_count(&self) -> usize
Get the number of states in the DFA.
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