Enum Ast
pub 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(Box<Span>) An empty regex that matches everything.
-
Flags(Box<SetFlags>) A set of flags, e.g.,
(?is).-
Literal(Box<Literal>) A single character literal, which includes escape sequences.
-
Dot(Box<Span>) The "any character" class.
-
Assertion(Box<Assertion>) A single zero-width assertion.
-
ClassUnicode(Box<ClassUnicode>) A single Unicode character class, e.g.,
\pLor\p{Greek}.-
ClassPerl(Box<ClassPerl>) A single perl character class, e.g.,
\dor\W.-
ClassBracketed(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(Box<Repetition>) A repetition operator applied to an arbitrary regular expression.
-
Group(Box<Group>) A grouped regular expression.
-
Alternation(Box<Alternation>) An alternation of regular expressions.
-
Concat(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) -> &SpanReturn the span of this abstract syntax tree.
fn is_empty(&self) -> boolReturn true if and only if this Ast is empty.
Trait Implementations
impl Clone for Ast
fn clone(&self) -> Self
impl Debug for Ast
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl Display for Ast
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl Drop for Ast
fn drop(&mut self)
impl Eq for Ast
impl PartialEq for Ast
fn eq(&self, other: &Self) -> bool
impl StructuralPartialEq for Ast
Auto Trait Implementations
impl Freeze for Ast
impl RefUnwindSafe for Ast
impl Send for Ast
impl Sync for Ast
impl Unpin for Ast
impl UnsafeUnpin for Ast
impl UnwindSafe for Ast
Blanket Implementations
impl<T> Any for Ast
where
T: 'static + ?Sized,
fn type_id(&self) -> TypeId
impl<T> Borrow<T> for Ast
where
T: ?Sized,
fn borrow(&self) -> &T
impl<T> BorrowMut<T> for Ast
where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
impl<T> CloneToUninit for Ast
where
T: Clone,
unsafe fn clone_to_uninit(&self, dest: *mut u8)
impl<T> From<T> for Ast
fn from(t: T) -> TReturns the argument unchanged.
impl<T> ToOwned for Ast
where
T: Clone,
type Owned = T;fn to_owned(&self) -> Tfn clone_into(&self, target: &mut T)
impl<T> ToString for Ast
where
T: Display + ?Sized,
fn to_string(&self) -> String
impl<T, U> Into<U> for Ast
where
U: From<T>,
fn into(self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom<U> for Ast
where
U: Into<T>,
type Error = never;fn try_from(value: U) -> Result<T, never>
impl<T, U> TryInto<U> for Ast
where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error;fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>