[][src]Enum cur::Scent

pub enum Scent {
    Clear,
    Atom(char),
    Range(char, char),
    Union(&'static [Scent]),
    Sequence(&'static [Scent]),
    Repetition(&'static ScentCast),
}

Represents a pattern to be matched against.

Variants

Clear

Matches an empty string.

Atom(char)

Matches a single char.

Range(char, char)

Matches any char inclusively between the two given.

Union(&'static [Scent])

Matches any given Scent.

Matches are attempted in the order of the Vec.

Sequence(&'static [Scent])

Matches each given Scent in the order of the Vec.

Repetition(&'static ScentCast)

Matches any number of repetitions of the given Scent, including 0.

If the given Cast is [Cast::Minimal], will first match with the fewest number of repetitions. Otherwise, will first match with the greatest number of repetitions.

Methods

impl Scent[src]

pub fn get_possible_detections(
    &self,
    chars: &[char],
    index: usize
) -> Vec<usize>
[src]

Return all possible detections of self in starting from index of chars.

A detection is the first index after the match.

Trait Implementations

impl Debug for Scent[src]

impl PartialEq<Scent> for Scent[src]

impl Copy for Scent[src]

impl Clone for Scent[src]

Auto Trait Implementations

impl Unpin for Scent

impl Send for Scent

impl Sync for Scent

Blanket Implementations

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.

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

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

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.

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

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

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

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

type Owned = T

The resulting type after obtaining ownership.