PatternMatcher

Trait PatternMatcher 

Source
pub trait PatternMatcher<'a, P> {
    // Required method
    fn find_first_from(
        &'a self,
        pattern: &P,
        byte_offset: usize,
    ) -> Option<PatternMatch<&'a Self>>;

    // Provided methods
    fn find_first(&'a self, pattern: &P) -> Option<PatternMatch<&'a Self>> { ... }
    fn find_every_from(
        &'a self,
        pattern: &P,
        byte_offset: usize,
    ) -> Option<Vec<PatternMatch<&'a Self>>> { ... }
    fn find_every(&'a self, pattern: &P) -> Option<Vec<PatternMatch<&'a Self>>> { ... }
    fn find_any_from<IIP: IntoIterator<Item = P>>(
        &'a self,
        patterns: IIP,
        byte_offset: usize,
    ) -> Option<PatternMatch<&'a Self>> { ... }
    fn find_any<IIP: IntoIterator<Item = P>>(
        &'a self,
        patterns: IIP,
    ) -> Option<PatternMatch<&'a Self>> { ... }
    fn find_all_from<IIP: IntoIterator<Item = P>>(
        &'a self,
        patterns: IIP,
        byte_offset: usize,
    ) -> Option<Vec<PatternMatch<&'a Self>>> { ... }
    fn find_all<IIP: IntoIterator<Item = P>>(
        &'a self,
        patterns: IIP,
    ) -> Option<Vec<PatternMatch<&'a Self>>> { ... }
}

Required Methods§

Source

fn find_first_from( &'a self, pattern: &P, byte_offset: usize, ) -> Option<PatternMatch<&'a Self>>

Provided Methods§

Source

fn find_first(&'a self, pattern: &P) -> Option<PatternMatch<&'a Self>>

Source

fn find_every_from( &'a self, pattern: &P, byte_offset: usize, ) -> Option<Vec<PatternMatch<&'a Self>>>

Source

fn find_every(&'a self, pattern: &P) -> Option<Vec<PatternMatch<&'a Self>>>

Source

fn find_any_from<IIP: IntoIterator<Item = P>>( &'a self, patterns: IIP, byte_offset: usize, ) -> Option<PatternMatch<&'a Self>>

Source

fn find_any<IIP: IntoIterator<Item = P>>( &'a self, patterns: IIP, ) -> Option<PatternMatch<&'a Self>>

Source

fn find_all_from<IIP: IntoIterator<Item = P>>( &'a self, patterns: IIP, byte_offset: usize, ) -> Option<Vec<PatternMatch<&'a Self>>>

Source

fn find_all<IIP: IntoIterator<Item = P>>( &'a self, patterns: IIP, ) -> Option<Vec<PatternMatch<&'a Self>>>

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.

Implementations on Foreign Types§

Source§

impl<'a, P> PatternMatcher<'a, P> for str
where P: AsRef<str>,

Source§

fn find_first_from( &'a self, pattern: &P, byte_offset: usize, ) -> Option<PatternMatch<&'a str>>

Source§

impl<'a, P, T> PatternMatcher<'a, P> for [T]
where P: AsRef<[T]>, T: PartialEq,

Source§

fn find_first_from( &'a self, pattern: &P, byte_offset: usize, ) -> Option<PatternMatch<&'a Self>>

Implementors§