Struct multibloom::BloomFilter
[−]
[src]
pub struct BloomFilter<H: Hasher> { /* fields omitted */ }
Methods
impl BloomFilter<SipHasher>
[src]
fn new(size: u64, hash_count: u64) -> BloomFilter<SipHasher>
Default BloomFilter
constructor using SipHasher
size
: The size of the bit vector being stored. (m)
hash_count
: The number of hash functions to use. (k)
fn new_with_params(n: u64, p: f32) -> BloomFilter<SipHasher>
Default BloomFilter
constructor for SipHasher using desired error rate and number of items
n
: The number of items that are going to be stored in the bloom filter.
p
: The allowable error rate of false positives
impl<H> BloomFilter<H> where
H: Hasher + Clone + Default,
[src]
H: Hasher + Clone + Default,
fn new_with_hasher(size: u64, hash_count: u64) -> BloomFilter<H>
Constructs a bloom filter, generic over hash function
fn new_with_params_with_hasher(n: u64, p: f32) -> BloomFilter<H>
Constructs a new Generic BloomFilter
using desired error rate and number of items
n
: The number of items that are going to be stored in the bloom filter.
p
: The allowable error rate of false positives
fn add<T: Hash>(&mut self, val: &T)
Add a Hashable type to the bloom filter.
fn query<T: Hash>(&self, query_val: &T) -> bool
Query the bloom filter for some Hashable value.
fn get_bits_set(&self) -> usize
Returns the number of bits set in the bloom filter.
This is an expensive operation, there's no reason to use it unless you're doing something strange
fn clear(&mut self)
Clears the bloom filter of all values.
Trait Implementations
impl<H> Debug for BloomFilter<H> where
H: Hasher + Clone + Default,
[src]
H: Hasher + Clone + Default,