[−][src]Struct automata::regex::Regex
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.
Methods
impl<A: Alphabet> Regex<A>
[src]
pub fn new() -> Self
[src]
pub fn push(&mut self, op: Op<A>) -> Handle
[src]
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.
pub fn root(&self) -> Option<Handle>
[src]
Get a root to the regex.
pub fn cached(self) -> Cached<A>
[src]
Modify the regex with a cache for same terms.
By using a cache for terms, it is possible to lower the memory requirements of the resulting regex through resued subexpressions.
pub fn to_string(&self) -> String
[src]
Get a string representation of this regex.
Trait Implementations
Auto Trait Implementations
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom 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> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,