Struct scalable_cuckoo_filter::ScalableCuckooFilter
[−]
[src]
pub struct ScalableCuckooFilter<T: ?Sized, H = DefaultHasher, R = DefaultRng> { /* fields omitted */ }
Scalable Cuckoo Filter.
Methods
impl<T: Hash + ?Sized> ScalableCuckooFilter<T>
[src]
pub fn new(
initial_capacity_hint: usize,
false_positive_probability: f64
) -> Self
[src]
initial_capacity_hint: usize,
false_positive_probability: f64
) -> Self
Makes a new ScalableCuckooFilter
instance.
This is equivalent to the following expression:
ScalableCuckooFilterBuilder::new() .initial_capacity(initial_capacity) .false_positive_probability(false_positive_probability) .finish()
impl<T: Hash + ?Sized, H: Hasher + Clone, R: Rng> ScalableCuckooFilter<T, H, R>
[src]
pub fn len(&self) -> usize
[src]
Returns the approximate number of items inserted in this filter.
pub fn is_empty(&self) -> bool
[src]
Returns true
if this filter contains no items, otherwise false
.
pub fn capacity(&self) -> usize
[src]
Returns the capacity (i.e., the upper bound of acceptable items count) of this filter.
"capacity" is upper bound of the number of items can be inserted into the filter without resizing.
pub fn bits(&self) -> u64
[src]
Returns the number of bits being used for representing this filter.
pub fn contains(&self, item: &T) -> bool
[src]
Returns true
if this filter may contain item
, otherwise false
.
pub fn insert(&mut self, item: &T)
[src]
Inserts item
into this filter.
If the current filter becomes full, it will be expanded automatically.
pub fn shrink_to_fit(&mut self)
[src]
Shrinks the capacity of this filter as much as possible.