Enum regex_syntax::ast::Ast[][src]

pub enum Ast {
    Empty(Span),
    Flags(SetFlags),
    Literal(Literal),
    Dot(Span),
    Assertion(Assertion),
    Class(Class),
    Repetition(Repetition),
    Group(Group),
    Alternation(Alternation),
    Concat(Concat),
}
Expand description

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(Span)

An empty regex that matches everything.

Tuple Fields of Empty

0: Span
Flags(SetFlags)

A set of flags, e.g., (?is).

Tuple Fields of Flags

0: SetFlags
Literal(Literal)

A single character literal, which includes escape sequences.

Tuple Fields of Literal

0: Literal
Dot(Span)

The “any character” class.

Tuple Fields of Dot

0: Span
Assertion(Assertion)

A single zero-width assertion.

Tuple Fields of Assertion

0: Assertion
Class(Class)

A single character class. This includes all forms of character classes except for .. e.g., \d, \pN, [a-z] and [[:alpha:]].

Tuple Fields of Class

0: Class
Repetition(Repetition)

A repetition operator applied to an arbitrary regular expression.

Tuple Fields of Repetition

0: Repetition
Group(Group)

A grouped regular expression.

Tuple Fields of Group

0: Group
Alternation(Alternation)

An alternation of regular expressions.

Tuple Fields of Alternation

0: Alternation
Concat(Concat)

A concatenation of regular expressions.

Tuple Fields of Concat

0: Concat

Implementations

Return the span of this abstract syntax tree.

Return true if and only if this Ast is empty.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Print a display representation of this Ast.

This does not preserve any of the original whitespace formatting that may have originally been present in the concrete syntax from which this Ast was generated.

This implementation uses constant stack space and heap space proportional to the size of the Ast.

Formats the value using the given formatter. Read more

A custom Drop impl is used for Ast such that it uses constant stack space but heap space proportional to the depth of the Ast.

Executes the destructor for this type. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.