Struct aho_corasick::util::prefilter::Memmem
source · struct Memmem(Finder<'static>);
Expand description
A type that wraps a SIMD accelerated single substring search from the
memchr
crate for use as a prefilter.
Currently, this prefilter is only active for Aho-Corasick searchers with a single pattern. In theory, this could be extended to support searchers that have a common prefix of more than one byte (for one byte, we would use memchr), but it’s not clear if it’s worth it or not.
Also, unfortunately, this currently also requires the ‘std’ feature to be enabled. That’s because memchr doesn’t have a no-std-but-with-alloc mode, and so APIs like Finder::into_owned aren’t available when ‘std’ is disabled. But there should be an ‘alloc’ feature that brings in APIs like Finder::into_owned but doesn’t use std-only features like runtime CPU feature detection.
Tuple Fields§
§0: Finder<'static>
Trait Implementations§
source§impl PrefilterI for Memmem
impl PrefilterI for Memmem
source§fn find_in(&self, haystack: &[u8], span: Span) -> Candidate
fn find_in(&self, haystack: &[u8], span: Span) -> Candidate
Auto Trait Implementations§
impl Freeze for Memmem
impl RefUnwindSafe for Memmem
impl Send for Memmem
impl Sync for Memmem
impl Unpin for Memmem
impl UnwindSafe for Memmem
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
)