Struct pdatastructs::BloomFilter [] [src]

pub struct BloomFilter { /* fields omitted */ }

Simple implementation of a BloomFilter

Methods

impl BloomFilter
[src]

[src]

Create new, empty BloomFilter with internal parameters.

  • k is the number of hash functions
  • m is the number of bits used to store state

[src]

Create new, empty BloomFilter with given properties.

  • n number of unique elements the BloomFilter is expected to hold, must be > 0
  • p false positive property when querying the BloomFilter after adding n unique elements, must be > 0 and < 1

Panics if the parameters are not in range.

[src]

Get k (number of hash functions).

[src]

Get m (number of stored bits).

[src]

Add new element to the BloomFilter.

If the same element is added multiple times or if an element results in the same hash signature, this method does not have any effect.

[src]

Guess if the given element was added to the BloomFilter.

[src]

Clear state of the BloomFilter, so that it behaves like a fresh one.

[src]

Check whether the BloomFilter is empty.

[src]

Add the entire content of another bloomfilter to this BloomFilter.

The result is the same as adding all elements added to other to self in the first place.

Panics if k and m of the two BloomFilters are not identical.

[src]

Guess the number of unique elements added to the BloomFilter.

Trait Implementations

impl Clone for BloomFilter
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for BloomFilter
[src]

[src]

Formats the value using the given formatter.