Struct FinderBuilder

pub struct FinderBuilder { /* private fields */ }

A builder for constructing non-default forward or reverse memmem finders.

A builder is primarily useful for configuring a substring searcher. Currently, the only configuration exposed is the ability to disable heuristic prefilters used to speed up certain searches.

Implementations

impl FinderBuilder

fn new() -> FinderBuilder

Create a new finder builder with default settings.

fn build_forward<'n, B: ?Sized + AsRef<[u8]>>(&self, needle: &'n B) -> Finder<'n>

Build a forward finder using the given needle from the current settings.

fn build_forward_owned<B: Into<Box<[u8]>>>(&self, needle: B) -> Finder<'static>

Build an owned forward finder using the given needle from the current settings.

fn build_forward_with_ranker<'n, R: HeuristicFrequencyRank, B: ?Sized + AsRef<[u8]>>(&self, ranker: R, needle: &'n B) -> Finder<'n>

Build a forward finder using the given needle and a custom heuristic for determining the frequency of a given byte in the dataset. See HeuristicFrequencyRank for more details.

fn build_forward_with_ranker_owned<R: HeuristicFrequencyRank, B: Into<Box<[u8]>>>(&self, ranker: R, needle: B) -> Finder<'static>

Build an owned forward finder using the given needle and a custom heuristic for determining the frequency of a given byte in the dataset. See HeuristicFrequencyRank for more details.

fn build_reverse<'n, B: ?Sized + AsRef<[u8]>>(&self, needle: &'n B) -> FinderRev<'n>

Build a reverse finder using the given needle from the current settings.

fn build_reverse_owned<B: Into<Box<[u8]>>>(&self, needle: B) -> FinderRev<'static>

Build an owned reverse finder using the given needle from the current settings.

fn prefilter(&mut self, prefilter: Prefilter) -> &mut FinderBuilder

Configure the prefilter setting for the finder.

See the documentation for Prefilter for more discussion on why you might want to configure this.

Trait Implementations

impl Clone for FinderBuilder

fn clone(&self) -> FinderBuilder

impl Debug for FinderBuilder

fn fmt(&self, f: &mut Formatter<'_>) -> Result

impl Default for FinderBuilder

fn default() -> FinderBuilder

Auto Trait Implementations

impl Freeze for FinderBuilder

impl RefUnwindSafe for FinderBuilder

impl Send for FinderBuilder

impl Sync for FinderBuilder

impl Unpin for FinderBuilder

impl UnsafeUnpin for FinderBuilder

impl UnwindSafe for FinderBuilder

Blanket Implementations

impl<T> Any for FinderBuilder where T: 'static + ?Sized,

fn type_id(&self) -> TypeId

impl<T> Borrow<T> for FinderBuilder where T: ?Sized,

fn borrow(&self) -> &T

impl<T> BorrowMut<T> for FinderBuilder where T: ?Sized,

fn borrow_mut(&mut self) -> &mut T

impl<T> CloneToUninit for FinderBuilder where T: Clone,

unsafe fn clone_to_uninit(&self, dest: *mut u8)

impl<T> From<T> for FinderBuilder

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> ToOwned for FinderBuilder where T: Clone,

type Owned = T;
fn to_owned(&self) -> T
fn clone_into(&self, target: &mut T)

impl<T, U> Into<U> for FinderBuilder where U: From<T>,

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom<U> for FinderBuilder where U: Into<T>,

type Error = never;
fn try_from(value: U) -> Result<T, never>

impl<T, U> TryInto<U> for FinderBuilder where U: TryFrom<T>,

type Error = <U as TryFrom<T>>::Error;
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>