Trait Pattern

Source
pub trait Pattern: LSend {
    // Required method
    fn matches(&self, tokens: &[Token], source: &[char]) -> Option<usize>;
}

Required Methods§

Source

fn matches(&self, tokens: &[Token], source: &[char]) -> Option<usize>

Check if the pattern matches at the start of the given token slice.

Returns the length of the match if successful, or None if not.

Implementations on Foreign Types§

Source§

impl<P: Pattern + ?Sized> Pattern for Arc<P>

Source§

fn matches(&self, tokens: &[Token], source: &[char]) -> Option<usize>

Implementors§