BloomFilter

Trait BloomFilter 

Source
pub trait BloomFilter {
    type Set: BloomSet;
    type Hasher: BuildHasher;

    // Required methods
    fn counters(&self) -> &Self::Set;
    fn insert<T: Hash>(&mut self, val: &T);
    fn contains<T: Hash>(&self, val: &T) -> bool;
    fn clear(&mut self);
}
Expand description

Supertrait for all types which act as Bloom filters.

Required Associated Types§

Required Methods§

Source

fn counters(&self) -> &Self::Set

Gets a reference to the underlying counters used by this BloomFilter.

Source

fn insert<T: Hash>(&mut self, val: &T)

Inserts val into the set.

Source

fn contains<T: Hash>(&self, val: &T) -> bool

Checks whether the set contains val.

Source

fn clear(&mut self)

Clears all values from the set.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<B, S, V> BloomFilter for SimpleBloomFilter<B, S, V>
where B: BloomSet, S: BuildHasher, V: AsRef<[S]>,

Source§

type Set = B

Source§

type Hasher = S