Skip to main content

Pattern

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.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§