pub enum Rule<'i> {
Show 13 variants Literal(Literal<'i>), CharClass(CharClass), Group(Group<'i>), Alternation(Alternation<'i>), Repetition(Box<Repetition<'i>>), Boundary(Boundary), Lookaround(Box<Lookaround<'i>>), Variable(Variable<'i>), Reference(Reference<'i>), Range(Range), StmtExpr(Box<StmtExpr<'i>>), Regex(Regex<'i>), Grapheme,
}
Expand description

A parsed pomsky expression, which might contain more sub-expressions.

Variants§

§

Literal(Literal<'i>)

A string literal

§

CharClass(CharClass)

A character class

§

Group(Group<'i>)

A group, i.e. a sequence of rules, possibly wrapped in parentheses.

§

Alternation(Alternation<'i>)

An alternation, i.e. a list of alternatives; at least one of them has to match.

§

Repetition(Box<Repetition<'i>>)

A repetition, i.e. a expression that must be repeated. The number of required repetitions is constrained by a lower and possibly an upper bound.

§

Boundary(Boundary)

A boundary (start of string, end of string or word boundary).

§

Lookaround(Box<Lookaround<'i>>)

A (positive or negative) lookahead or lookbehind.

§

Variable(Variable<'i>)

An variable that has been declared before.

§

Reference(Reference<'i>)

A backreference or forward reference.

§

Range(Range)

A range of integers

§

StmtExpr(Box<StmtExpr<'i>>)

An expression preceded by a modifier such as enable lazy;

§

Regex(Regex<'i>)

A regex string, which is not escaped

§

Grapheme

A Unicode grapheme

Implementations§

Returns the span of this rule

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more

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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. 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.