pub struct FinderRev(TwoWay);
Expand description
A reverse substring searcher that uses the Two-Way algorithm.
Tuple Fields§
§0: TwoWay
Implementations§
source§impl FinderRev
impl FinderRev
sourcepub fn new(needle: &[u8]) -> FinderRev
pub fn new(needle: &[u8]) -> FinderRev
Create a searcher that finds occurrences of the given needle
.
An empty needle
results in a match at every position in a haystack,
including at haystack.len()
.
sourcepub fn rfind(&self, haystack: &[u8], needle: &[u8]) -> Option<usize>
pub fn rfind(&self, haystack: &[u8], needle: &[u8]) -> Option<usize>
Returns the last occurrence of needle
in the given haystack
, or
None
if no such occurrence could be found.
The needle
given must be the same as the needle
provided to
FinderRev::new
.
An empty needle
results in a match at every position in a haystack,
including at haystack.len()
.
fn rfind_small_imp( &self, haystack: &[u8], needle: &[u8], period: usize, ) -> Option<usize>
fn rfind_large_imp( &self, haystack: &[u8], needle: &[u8], shift: usize, ) -> Option<usize>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FinderRev
impl RefUnwindSafe for FinderRev
impl Send for FinderRev
impl Sync for FinderRev
impl Unpin for FinderRev
impl UnwindSafe for FinderRev
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more