pub struct ScalableCuckooFilterBuilder<H = DefaultHasher, R = DefaultRng> { /* private fields */ }
Expand description
Builder for ScalableCuckooFilter
.
Implementations§
source§impl<H: Hasher + Clone, R: Rng> ScalableCuckooFilterBuilder<H, R>
impl<H: Hasher + Clone, R: Rng> ScalableCuckooFilterBuilder<H, R>
sourcepub fn initial_capacity(self, capacity_hint: usize) -> Self
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
.
sourcepub fn false_positive_probability(self, probability: f64) -> Self
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
.
sourcepub fn entries_per_bucket(self, n: usize) -> Self
pub fn entries_per_bucket(self, n: usize) -> Self
Sets the number of entries per bucket of this filter.
The default value is 4
.
sourcepub fn max_kicks(self, kicks: usize) -> Self
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
.
sourcepub fn hasher<T: Hasher>(self, hasher: T) -> ScalableCuckooFilterBuilder<T, R>
pub fn hasher<T: Hasher>(self, hasher: T) -> ScalableCuckooFilterBuilder<T, R>
Sets the hasher of this filter.
The default value if DefaultHasher::new()
.
sourcepub fn rng<T: Rng>(self, rng: T) -> ScalableCuckooFilterBuilder<H, T>
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()
.
sourcepub fn finish<T: Hash + ?Sized>(self) -> ScalableCuckooFilter<T, H, R>
pub fn finish<T: Hash + ?Sized>(self) -> ScalableCuckooFilter<T, H, R>
Builds a ScalableCuckooFilter
instance.