Enum Rule

Source
pub enum Rule<'i> {
Show 17 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>>), Negation(Box<Negation<'i>>), Regex(Regex<'i>), Recursion(Recursion), Grapheme, Codepoint, Dot,
}
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;

§

Negation(Box<Negation<'i>>)

Negated expression

§

Regex(Regex<'i>)

A regex string, which is not escaped

§

Recursion(Recursion)

A regex string, which is not escaped

§

Grapheme

A Unicode grapheme

§

Codepoint

A Unicode code point

§

Dot

The dot

Implementations§

Source§

impl<'i> Rule<'i>

Source

pub fn span(&self) -> Span

Returns the span of this rule

Trait Implementations§

Source§

impl<'i> Clone for Rule<'i>

Source§

fn clone(&self) -> Rule<'i>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

§

impl<'i> Freeze for Rule<'i>

§

impl<'i> RefUnwindSafe for Rule<'i>

§

impl<'i> Send for Rule<'i>

§

impl<'i> Sync for Rule<'i>

§

impl<'i> Unpin for Rule<'i>

§

impl<'i> UnwindSafe for Rule<'i>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.