pub struct ScalableCuckooFilter<T: ?Sized, H = DefaultHasher, R = DefaultRng> { /* private fields */ }
Expand description

Scalable Cuckoo Filter.

Implementations§

source§

impl<T: Hash + ?Sized> ScalableCuckooFilter<T>

source

pub fn new( 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()
source§

impl<T: Hash + ?Sized, H: Hasher + Clone, R: Rng> ScalableCuckooFilter<T, H, R>

source

pub fn len(&self) -> usize

Returns the approximate number of items inserted in this filter.

source

pub fn is_empty(&self) -> bool

Returns true if this filter contains no items, otherwise false.

source

pub fn capacity(&self) -> usize

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.

source

pub fn bits(&self) -> u64

Returns the number of bits being used for representing this filter.

source

pub fn contains(&self, item: &T) -> bool

Returns true if this filter may contain item, otherwise false.

source

pub fn insert(&mut self, item: &T)

Inserts item into this filter.

If the current filter becomes full, it will be expanded automatically.

source

pub fn shrink_to_fit(&mut self)

Shrinks the capacity of this filter as much as possible.

source

pub fn remove(&mut self, item: &T)

Removes item from this filter.

Trait Implementations§

source§

impl<T: Clone + ?Sized, H: Clone, R: Clone> Clone for ScalableCuckooFilter<T, H, R>

source§

fn clone(&self) -> ScalableCuckooFilter<T, H, R>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T: Debug + ?Sized, H: Debug, R: Debug> Debug for ScalableCuckooFilter<T, H, R>

source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<T: ?Sized, H, R> RefUnwindSafe for ScalableCuckooFilter<T, H, R>

§

impl<T: ?Sized, H, R> Send for ScalableCuckooFilter<T, H, R>
where H: Send, R: Send, T: Send,

§

impl<T: ?Sized, H, R> Sync for ScalableCuckooFilter<T, H, R>
where H: Sync, R: Sync, T: Sync,

§

impl<T: ?Sized, H, R> Unpin for ScalableCuckooFilter<T, H, R>
where H: Unpin, R: Unpin, T: Unpin,

§

impl<T: ?Sized, H, R> UnwindSafe for ScalableCuckooFilter<T, H, R>
where H: UnwindSafe, R: UnwindSafe, T: 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> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
§

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

§

fn vzip(self) -> V