pub struct FinderRev(/* private fields */);
Expand description
A reverse substring searcher that uses the Two-Way algorithm.
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()
.
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 32 bytes