pub struct BloomFilter { /* private fields */ }
Expand description

A variant of bloom filter

Every hash function has it’s own slice instead of sharing the whole bitmap. This introduce the possibility of concurrency of manipulating multiply hash function at the same time.

Implementations

Create an empty bloom filter from scratch.

Generally, user should not use this initializer directly. Promise the limitation on yourself:

  • 0 < k <= u32::MAX
  • 0 < m <= u32::MAX
  • 0 < f < 1

Create an empty bloom filter with max element’s size and false positive rate. The crate would calculate the best buckets length and bucket size.

Add new element into the bloom filter. Return true when any key are inserted in a slice.

Check if the bloom filter contains the specific key. Return true when all key are present in all slices, which may contains false positive situation.

Get target false positive rate.

Get current false positive rate.

If this bloom filter is empty.

If this bloom filter is full.

Get the number of inserted elements in this bloom filter.

Get the number of inserted bits in all slices.

Trait Implementations

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.

Converts the given value to a String. 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.