pub struct Regex<A: Alphabet> { /* private fields */ }
Expand description
Represents regular expressions over some finite alphabet.
Optimizes storage and construction for reoccurring subexpressions to allow polynomial time conversion from NFA. You can create (and keep) handles on subexpressions, then evaluate as if those subexpressions were at the root. This relationship forms an acyclic graph.
Implementations§
Source§impl<A: Alphabet> Regex<A>
impl<A: Alphabet> Regex<A>
pub fn new() -> Self
Sourcepub fn push(&mut self, op: Op<A>) -> Handle
pub fn push(&mut self, op: Op<A>) -> Handle
Push a new operation as the regex root.
It is not required that all regex states are reachable afterwards but all handles must point to existing operations. Returns a handle on the newly inserted operation.
Trait Implementations§
Auto Trait Implementations§
impl<A> Freeze for Regex<A>
impl<A> RefUnwindSafe for Regex<A>where
A: RefUnwindSafe,
impl<A> Send for Regex<A>where
A: Send,
impl<A> Sync for Regex<A>where
A: Sync,
impl<A> Unpin for Regex<A>where
A: Unpin,
impl<A> UnwindSafe for Regex<A>where
A: UnwindSafe,
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