Type Alias selectors::bloom::BloomFilter

source ·
pub type BloomFilter = CountingBloomFilter<BloomStorageU8>;
Expand description

A counting Bloom filter with 8-bit counters.

Aliased Type§

struct BloomFilter {
    storage: BloomStorageU8,
}

Fields§

§storage: BloomStorageU8

Implementations§

source§

impl<S> CountingBloomFilter<S>where S: BloomStorage,

source

pub fn new() -> Self

Creates a new bloom filter.

source

pub fn clear(&mut self)

source

pub fn is_zeroed(&self) -> bool

source

pub fn insert_hash(&mut self, hash: u32)

Inserts an item with a particular hash into the bloom filter.

source

pub fn remove_hash(&mut self, hash: u32)

Removes an item with a particular hash from the bloom filter.

source

pub fn might_contain_hash(&self, hash: u32) -> bool

Check whether the filter might contain an item with the given hash. This can sometimes return true even if the item is not in the filter, but will never return false for items that are actually in the filter.

Trait Implementations§

source§

impl<S> Clone for CountingBloomFilter<S>where S: BloomStorage + Clone,

source§

fn clone(&self) -> CountingBloomFilter<S>

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<S> Debug for CountingBloomFilter<S>where S: BloomStorage,

source§

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

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

impl<S> Default for CountingBloomFilter<S>where S: BloomStorage + Default,

source§

fn default() -> CountingBloomFilter<S>

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