Struct bloom_filter::BloomBuilder
[−]
[src]
pub struct BloomBuilder { /* fields omitted */ }
BloomBuilder
A struct used to create bloom filters. The user must specify the number of elements they expect to insert into the bloom filter, and an aditional constraint: either the size of the bloom filter in bits, or the desired false positive ratio.
Methods
impl BloomBuilder
[src]
fn new(elements: u64) -> BloomBuilder
Create a new BloomBuilder. elements
is the number of elements that will be
inserted into the bloom filter.
fn with_size(self, size: u64) -> BloomBuilder
Set the size, in bits, of the desired bloom filter. Either with_size
or with_fpr
must be called.
fn with_fpr(self, p: f64) -> BloomBuilder
Set the false positive ratio of the desired bloom filter. Either with_size
or
with_fpr
must be called.
fn finish<T>(&self) -> Result<Bloom<T>, BloomError> where
T: Hash,
T: Hash,
Once the desired size of false positive ratio has been set, finish
is used to
return the desired bloom filter.