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§
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>
fn handle_overlapping_empty_match<F>( &mut self, m: Self::Match, finder: F, ) -> Result<Option<Self::Match>, Self::MatchError>
Provided Methods§
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.