pub struct Automaton { /* private fields */ }
Expand description
A regex automaton is a compiled regular expression.
It represents the state machine corresponding to the Regex
.
This struct can either be turned into a
DynamicMatcher
to match on a regex that was compiled at runtime.- An implementation of
RegexMatcher
generated using emit.
This function can be called at compile time (through the compile_regex!
macro) and it
emits the Rust code that can match the regular expression.
You can create an automaton using Regex::compile
Implementations§
Source§impl Automaton
impl Automaton
Sourcepub fn matcher(&self) -> DynamicMatcher<'_>
pub fn matcher(&self) -> DynamicMatcher<'_>
Instantiate a (dynamic) matcher of this automaton.
A matcher holds, in addition to the state machine,
also information about which state the machine is currently in.
This current state can then be updated by taking transitions using
step
.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Automaton
impl RefUnwindSafe for Automaton
impl !Send for Automaton
impl !Sync for Automaton
impl Unpin for Automaton
impl UnwindSafe for Automaton
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