Enum enso_automata::pattern::Pattern[][src]

pub enum Pattern {
    Range(RangeInclusive<Symbol>),
    Or(Vec<Pattern>),
    Seq(Vec<Pattern>),
    Many(Box<Pattern>),
    Always,
    Never,
}
Expand description

A representation of a simple regular pattern.

Variants

Expand description

The pattern that triggers on any symbol from the given range.

Expand description

The pattern that triggers on any given pattern from a sequence.

Seq(Vec<Pattern>)
Expand description

The pattern that triggers when a sequence of patterns is encountered.

Many(Box<Pattern>)
Expand description

The pattern that triggers on 0..N repetitions of given pattern.

Always
Expand description

The pattern that always triggers without consuming any input.

Never
Expand description

The pattern that never triggers and does not consume any input.

Implementations

impl Pattern[src]

pub fn never() -> Self[src]

A pattern that never triggers.

pub fn always() -> Self[src]

A pattern that always triggers

pub fn any() -> Self[src]

A pattern that triggers on any character.

pub fn min() -> Self[src]

A pattern that triggers on the minimum value.

pub fn max() -> Self[src]

A pattern that triggers on the minimum value.

pub fn many(&self) -> Self[src]

A pattern that triggers on 0..N repetitions of the pattern described by self.

pub fn many1(&self) -> Self[src]

A pattern that triggers on 1..N repetitions of the pattern described by self.

pub fn opt(&self) -> Self[src]

A pattern that triggers on 0..=1 repetitions of the pattern described by self.

pub fn char(character: char) -> Self[src]

A pattern that triggers on the given character.

pub fn symbol(symbol: &Symbol) -> Self[src]

A pattern that triggers on the given symbol.

pub fn symbols(symbols: RangeInclusive<Symbol>) -> Self[src]

A pattern that triggers on any of the provided symbols.

pub fn eof() -> Self[src]

A pattern that triggers at the end of the file.

pub fn range(range: RangeInclusive<char>) -> Self[src]

A pattern that triggers on any character in the provided range.

pub fn all_of(chars: &str) -> Self[src]

Pattern that triggers when sequence of characters given by chars is encountered.

pub fn any_of(chars: &str) -> Self[src]

The pattern that triggers on any characters contained in chars.

pub fn none_of(chars: &str) -> Self[src]

The pattern that doesn’t trigger on any character contained in chars.

This pattern will always implicitly include [Symbol::NULL] and [Symbol::EOF_CODE] in the excluded characters. If you do not want this behaviour instead use Pattern::none_of_codes below.

pub fn none_of_codes(codes: &[u64], names: &[String]) -> Self[src]

This pattern doesn’t trigger on any code contained in codes.

pub fn not(char: char) -> Self[src]

The pattern that triggers on any character but char.

pub fn not_symbol(symbol: Symbol) -> Self[src]

The pattern that triggers on any symbol but symbol.

pub fn repeat(pat: &Pattern, num: usize) -> Self[src]

The pattern that triggers on num repetitions of pat.

pub fn repeat_between(pat: &Pattern, min: usize, max: usize) -> Self[src]

Pattern that triggers on min..max repetitions of pat.

Trait Implementations

impl AsRef<Pattern> for Pattern[src]

fn as_ref(&self) -> &Pattern[src]

Performs the conversion.

impl BitOr<&'_ Pattern> for Pattern[src]

type Output = Pattern

The resulting type after applying the | operator.

fn bitor(self, rhs: &Pattern) -> Self::Output[src]

Performs the | operation. Read more

impl BitOr<&'_ Pattern> for &Pattern[src]

type Output = Pattern

The resulting type after applying the | operator.

fn bitor(self, rhs: &Pattern) -> Self::Output[src]

Performs the | operation. Read more

impl BitOr<Pattern> for Pattern[src]

type Output = Pattern

The resulting type after applying the | operator.

fn bitor(self, rhs: Pattern) -> Self::Output[src]

Performs the | operation. Read more

impl BitOr<Pattern> for &Pattern[src]

type Output = Pattern

The resulting type after applying the | operator.

fn bitor(self, rhs: Pattern) -> Self::Output[src]

Performs the | operation. Read more

impl Clone for Pattern[src]

fn clone(&self) -> Pattern[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for Pattern[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl From<&'_ str> for Pattern[src]

fn from(string: &str) -> Self[src]

Performs the conversion.

impl From<char> for Pattern[src]

fn from(char: char) -> Self[src]

Performs the conversion.

impl PartialEq<Pattern> for Pattern[src]

fn eq(&self, other: &Pattern) -> bool[src]

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

fn ne(&self, other: &Pattern) -> bool[src]

This method tests for !=.

impl Shr<&'_ Pattern> for Pattern[src]

type Output = Pattern

The resulting type after applying the >> operator.

fn shr(self, rhs: &Pattern) -> Self::Output[src]

Performs the >> operation. Read more

impl Shr<&'_ Pattern> for &Pattern[src]

type Output = Pattern

The resulting type after applying the >> operator.

fn shr(self, rhs: &Pattern) -> Self::Output[src]

Performs the >> operation. Read more

impl Shr<Pattern> for Pattern[src]

type Output = Pattern

The resulting type after applying the >> operator.

fn shr(self, rhs: Pattern) -> Self::Output[src]

Performs the >> operation. Read more

impl Shr<Pattern> for &Pattern[src]

type Output = Pattern

The resulting type after applying the >> operator.

fn shr(self, rhs: Pattern) -> Self::Output[src]

Performs the >> operation. Read more

impl StructuralPartialEq for Pattern[src]

Auto Trait Implementations

impl RefUnwindSafe for Pattern

impl Send for Pattern

impl Sync for Pattern

impl Unpin for Pattern

impl UnwindSafe for Pattern

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T> HasRefValue for T where
    T: ?Sized
[src]

type RefValue = T

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> PhantomConversions for T[src]

fn phantom_into<P>() -> P where
    Self: PhantomInto<P>, 
[src]

fn phantom_from<P>() -> Self where
    P: PhantomInto<Self>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 

pub fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more

pub fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).

pub fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.

pub fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.

impl<T> ToImpl for T[src]

fn to<P>(self) -> P where
    Self: Into<P>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

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

pub fn clone_into(&self, target: &mut T)[src]

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

recently added

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

impl<T> ToRef<T> for T where
    T: ?Sized
[src]

pub fn to_ref(&self) -> &T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<T> TypeDisplay for T[src]

pub default fn type_display() -> String[src]

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

pub fn vzip(self) -> V