Enum Ast
enum Ast
An abstract syntax tree for a single regular expression.
An Ast's fmt::Display implementation uses constant stack space and heap
space proportional to the size of the Ast.
This type defines its own destructor that uses constant stack space and
heap space proportional to the size of the Ast.
Variants
-
Empty(alloc::boxed::Box<Span>) An empty regex that matches everything.
-
Flags(alloc::boxed::Box<SetFlags>) A set of flags, e.g.,
(?is).-
Literal(alloc::boxed::Box<Literal>) A single character literal, which includes escape sequences.
-
Dot(alloc::boxed::Box<Span>) The "any character" class.
-
Assertion(alloc::boxed::Box<Assertion>) A single zero-width assertion.
-
ClassUnicode(alloc::boxed::Box<ClassUnicode>) A single Unicode character class, e.g.,
\pLor\p{Greek}.-
ClassPerl(alloc::boxed::Box<ClassPerl>) A single perl character class, e.g.,
\dor\W.-
ClassBracketed(alloc::boxed::Box<ClassBracketed>) A single bracketed character class set, which may contain zero or more character ranges and/or zero or more nested classes. e.g.,
[a-zA-Z\pL].-
Repetition(alloc::boxed::Box<Repetition>) A repetition operator applied to an arbitrary regular expression.
-
Group(alloc::boxed::Box<Group>) A grouped regular expression.
-
Alternation(alloc::boxed::Box<Alternation>) An alternation of regular expressions.
-
Concat(alloc::boxed::Box<Concat>) A concatenation of regular expressions.
Implementations
impl Ast
fn empty(span: Span) -> AstCreate an "empty" AST item.
fn flags(e: SetFlags) -> AstCreate a "flags" AST item.
fn literal(e: Literal) -> AstCreate a "literal" AST item.
fn dot(span: Span) -> AstCreate a "dot" AST item.
fn assertion(e: Assertion) -> AstCreate a "assertion" AST item.
fn class_unicode(e: ClassUnicode) -> AstCreate a "Unicode class" AST item.
fn class_perl(e: ClassPerl) -> AstCreate a "Perl class" AST item.
fn class_bracketed(e: ClassBracketed) -> AstCreate a "bracketed class" AST item.
fn repetition(e: Repetition) -> AstCreate a "repetition" AST item.
fn group(e: Group) -> AstCreate a "group" AST item.
fn alternation(e: Alternation) -> AstCreate a "alternation" AST item.
fn concat(e: Concat) -> AstCreate a "concat" AST item.
fn span(self: &Self) -> &SpanReturn the span of this abstract syntax tree.
fn is_empty(self: &Self) -> boolReturn true if and only if this Ast is empty.
impl Clone for Ast
fn clone(self: &Self) -> Ast
impl Debug for Ast
fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result
impl Display for Ast
fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result
impl Drop for Ast
fn drop(self: &mut Self)
impl Eq for Ast
impl Freeze for Ast
impl PartialEq for Ast
fn eq(self: &Self, other: &Ast) -> bool
impl RefUnwindSafe for Ast
impl Send for Ast
impl StructuralPartialEq for Ast
impl Sync for Ast
impl Unpin for Ast
impl UnsafeUnpin for Ast
impl UnwindSafe for Ast
impl<T> Any for Ast
fn type_id(self: &Self) -> TypeId
impl<T> Borrow for Ast
fn borrow(self: &Self) -> &T
impl<T> BorrowMut for Ast
fn borrow_mut(self: &mut Self) -> &mut T
impl<T> CloneToUninit for Ast
unsafe fn clone_to_uninit(self: &Self, dest: *mut u8)
impl<T> From for Ast
fn from(t: T) -> TReturns the argument unchanged.
impl<T> ToOwned for Ast
fn to_owned(self: &Self) -> Tfn clone_into(self: &Self, target: &mut T)
impl<T> ToString for Ast
fn to_string(self: &Self) -> String
impl<T, U> Into for Ast
fn into(self: Self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom for Ast
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto for Ast
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>