Struct Prefilter
struct Prefilter { ... }
A prefilter for accelerating a search.
This crate uses prefilters in the core search implementations to accelerate common cases. They typically only apply to cases where there are a small number of patterns (less than 100 or so), but when they do, thoughput can be boosted considerably, perhaps by an order of magnitude. When a prefilter is active, it is used whenever a search enters an automaton's start state.
Currently, prefilters cannot be constructed by
callers. A Prefilter can only be accessed via the
Automaton::prefilter
method and used to execute a search. In other words, a prefilter can be
used to optimize your own search implementation if necessary, but cannot do
much else. If you have a use case for more APIs, please submit an issue.
Implementations
impl Prefilter
fn find_in(self: &Self, haystack: &[u8], span: Span) -> CandidateExecute a search in the haystack within the span given. If a match or a possible match is returned, then it is guaranteed to occur within the bounds of the span.
If the span provided is invalid for the given haystack, then behavior is unspecified.
impl Clone for Prefilter
fn clone(self: &Self) -> Prefilter
impl Debug for Prefilter
fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result
impl Freeze for Prefilter
impl RefUnwindSafe for Prefilter
impl Send for Prefilter
impl Sync for Prefilter
impl Unpin for Prefilter
impl UnsafeUnpin for Prefilter
impl UnwindSafe for Prefilter
impl<T> Any for Prefilter
fn type_id(self: &Self) -> TypeId
impl<T> Borrow for Prefilter
fn borrow(self: &Self) -> &T
impl<T> BorrowMut for Prefilter
fn borrow_mut(self: &mut Self) -> &mut T
impl<T> CloneToUninit for Prefilter
unsafe fn clone_to_uninit(self: &Self, dest: *mut u8)
impl<T> From for Prefilter
fn from(t: T) -> TReturns the argument unchanged.
impl<T> ToOwned for Prefilter
fn to_owned(self: &Self) -> Tfn clone_into(self: &Self, target: &mut T)
impl<T, U> Into for Prefilter
fn into(self: Self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom for Prefilter
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto for Prefilter
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>