Trait bstring::pattern::DoubleEndedSearcher
[−]
[src]
pub trait DoubleEndedSearcher<'a>: ReverseSearcher<'a> { }
A marker trait to express that a ReverseSearcher
can be used for a DoubleEndedIterator
implementation.
For this, the impl of Searcher
and ReverseSearcher
need
to follow these conditions:
- All results of
next()
need to be identical to the results ofnext_back()
in reverse order. next()
andnext_back()
need to behave as the two ends of a range of values, that is they can not "walk past each other".
Examples
u8::Searcher
is a DoubleEndedSearcher
because searching for a
u8
only requires looking at one at a time, which behaves the same
from both ends.
(&bstr)::Searcher
is not a DoubleEndedSearcher
because
the pattern "aa"
in the haystack "aaa"
matches as either
"[aa]a"
or "a[aa]"
, depending from which side it is searched.
Implementors
impl<'a> DoubleEndedSearcher<'a> for ByteSearcher<'a>
impl<'a, 'b> DoubleEndedSearcher<'a> for ByteSliceSearcher<'a, 'b>
impl<'a, F> DoubleEndedSearcher<'a> for BytePredicateSearcher<'a, F> where
F: FnMut(u8) -> bool,