Struct bloom_rs::BloomFilter
[−]
[src]
pub struct BloomFilter { /* fields omitted */ }
Representation of a bloom filter.
Methods
impl BloomFilter
[src]
fn new(bits_num: usize, times: usize) -> Self
Creates a new BloomFilter instance.
fn bits_num(&self) -> usize
Returns the capacity of the bloom filter.
fn add<T: Hash>(&mut self, data: T)
Add a new item to the bloom filter.
fn contains<T: Hash>(&self, data: T) -> bool
Check whether the item is in the bloom filter. If true, the result might be false positive. If false, the data is definitely not in the set.
fn clear_all(&mut self) -> &mut Self
Clear all items inserted in the bloom filter.