pub struct ScalableCuckooFilterBuilder<H = DefaultHasher, R = DefaultRng> { /* private fields */ }
Expand description

Builder for ScalableCuckooFilter.

Implementations§

source§

impl ScalableCuckooFilterBuilder<DefaultHasher, DefaultRng>

source

pub fn new() -> Self

Makes a new ScalableCuckooFilterBuilder instance.

source§

impl<H: Hasher + Clone, R: Rng> ScalableCuckooFilterBuilder<H, R>

source

pub fn initial_capacity(self, capacity_hint: usize) -> Self

Sets the initial capacity (i.e., the number of estimated maximum items) of this filter.

The default value is 100_000.

source

pub fn false_positive_probability(self, probability: f64) -> Self

Sets the expected upper bound of the false positive probability of this filter.

The default value is 0.001.

§Panics

This method panics if probability is not a non-negative number smaller than or equal to 1.0.

source

pub fn entries_per_bucket(self, n: usize) -> Self

Sets the number of entries per bucket of this filter.

The default value is 4.

source

pub fn max_kicks(self, kicks: usize) -> Self

Sets the maximum number of relocations in an insertion.

If this limit exceeded, the filter will be expanded.

The default value is 512.

source

pub fn hasher<T: Hasher>(self, hasher: T) -> ScalableCuckooFilterBuilder<T, R>

Sets the hasher of this filter.

The default value if DefaultHasher::new().

source

pub fn rng<T: Rng>(self, rng: T) -> ScalableCuckooFilterBuilder<H, T>

Sets the random number generator of this filter.

The default value is rand::thread_rng().

source

pub fn finish<T: Hash + ?Sized>(self) -> ScalableCuckooFilter<T, H, R>

Builds a ScalableCuckooFilter instance.

Trait Implementations§

source§

impl<H: Debug, R: Debug> Debug for ScalableCuckooFilterBuilder<H, R>

source§

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

Formats the value using the given formatter. Read more
source§

impl Default for ScalableCuckooFilterBuilder

source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<H, R> Freeze for ScalableCuckooFilterBuilder<H, R>
where H: Freeze, R: Freeze,

§

impl<H, R> RefUnwindSafe for ScalableCuckooFilterBuilder<H, R>

§

impl<H, R> Send for ScalableCuckooFilterBuilder<H, R>
where H: Send, R: Send,

§

impl<H, R> Sync for ScalableCuckooFilterBuilder<H, R>
where H: Sync, R: Sync,

§

impl<H, R> Unpin for ScalableCuckooFilterBuilder<H, R>
where H: Unpin, R: Unpin,

§

impl<H, R> UnwindSafe for ScalableCuckooFilterBuilder<H, R>
where H: UnwindSafe, R: UnwindSafe,

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

source§

fn into(self) -> U

Calls U::from(self).

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

source§

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

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

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

Performs the conversion.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V