pub trait Searcher {
    type Input: Input;
    type Match: Match;
    type MatchError: Error;

    // Required methods
    fn input(&self) -> &Self::Input;
    fn last_match_end(&self) -> Option<usize>;
    fn set_last_match_end(&mut self, end: usize);
    fn set_range<R>(&mut self, range: R)
       where R: RangeBounds<usize>;
    fn try_advance<F>(
        &mut self,
        finder: F
    ) -> Result<Option<Self::Match>, Self::MatchError>
       where F: FnMut(&Self::Input) -> Result<Option<Self::Match>, Self::MatchError>;
    fn handle_overlapping_empty_match<F>(
        &mut self,
        m: Self::Match,
        finder: F
    ) -> Result<Option<Self::Match>, Self::MatchError>
       where F: FnMut(&Self::Input) -> Result<Option<Self::Match>, Self::MatchError>;

    // Provided method
    fn advance<F>(&mut self, finder: F) -> Option<Self::Match>
       where F: FnMut(&Self::Input) -> Result<Option<Self::Match>, Self::MatchError> { ... }
}

Required Associated Types§

Required Methods§

source

fn input(&self) -> &Self::Input

source

fn last_match_end(&self) -> Option<usize>

source

fn set_last_match_end(&mut self, end: usize)

source

fn set_range<R>(&mut self, range: R)
where R: RangeBounds<usize>,

source

fn try_advance<F>( &mut self, finder: F ) -> Result<Option<Self::Match>, Self::MatchError>
where F: FnMut(&Self::Input) -> Result<Option<Self::Match>, Self::MatchError>,

source

fn handle_overlapping_empty_match<F>( &mut self, m: Self::Match, finder: F ) -> Result<Option<Self::Match>, Self::MatchError>
where F: FnMut(&Self::Input) -> Result<Option<Self::Match>, Self::MatchError>,

Provided Methods§

source

fn advance<F>(&mut self, finder: F) -> Option<Self::Match>
where F: FnMut(&Self::Input) -> Result<Option<Self::Match>, Self::MatchError>,

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<I, M, E> Searcher for DefaultSearcher<I, M, E>
where I: Input, M: Match, E: Error,

§

type Input = I

§

type Match = M

§

type MatchError = E