pub struct FilterBuilder {
    pub expected_elements: u64,
    pub false_positive_probability: f64,
    pub size: u64,
    pub hashes: u32,
    /* private fields */
}
Expand description

Builder for Bloom Filters.

Fields

expected_elements: u64false_positive_probability: f64size: u64hashes: u32

Implementations

Constructs a new Bloom Filter Builder by specifying the expected size of the filter and the tolerable false positive probability. The size of the BLoom filter in in bits and the optimal number of hash functions will be inferred from this.

Examples
use fastbloom_rs::FilterBuilder;
let mut builder = FilterBuilder::new(100_000_000, 0.01);
let bloom = builder.build_bloom_filter();

Constructs a new Bloom Filter Builder by specifying the size of the bloom filter in bits and the number of hashes. The expected size of the filter and the tolerable false positive probability will be inferred from this.

Constructs a Bloom filter using the specified parameters and computing missing parameters if possible (e.g. the optimal Bloom filter bit size).

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.