Trait PatternExt

Source
pub trait PatternExt {
    // Required method
    fn iter_matches(
        &self,
        tokens: &[Token],
        source: &[char],
    ) -> impl Iterator<Item = Span>;

    // Provided method
    fn find_all_matches(&self, tokens: &[Token], source: &[char]) -> Vec<Span> { ... }
}

Required Methods§

Source

fn iter_matches( &self, tokens: &[Token], source: &[char], ) -> impl Iterator<Item = Span>

Provided Methods§

Source

fn find_all_matches(&self, tokens: &[Token], source: &[char]) -> Vec<Span>

Search through all tokens to locate all non-overlapping pattern matches.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<P> PatternExt for P
where P: Pattern + ?Sized,