Struct CountingBloomFilter

Source
pub struct CountingBloomFilter { /* private fields */ }
Expand description

A Counting Bloom filter works in a similar manner as a regular Bloom filter; however, it is able to keep track of insertions and deletions. In a counting Bloom filter, each entry in the Bloom filter is a small counter associated with a basic Bloom filter bit.

Reference: F. Bonomi, M. Mitzenmacher, R. Panigrahy, S. Singh, and G. Varghese, “An Improved Construction for Counting Bloom Filters,” in 14th Annual European Symposium on Algorithms, LNCS 4168, 2006

Implementations§

Source§

impl CountingBloomFilter

Source

pub fn get_u8_array(&self) -> &[u8]

Source§

impl CountingBloomFilter

Source

pub fn get_u16_array(&self) -> &[u16]

Source§

impl CountingBloomFilter

Source

pub fn get_u32_array(&self) -> &[u32]

Source§

impl CountingBloomFilter

Source

pub fn get_u64_array(&self) -> &[u64]

Source§

impl CountingBloomFilter

Source

pub fn new(config: FilterBuilder) -> Self

Source

pub fn config(&self) -> FilterBuilder

Returns the configuration/builder of the Bloom filter.

§Examples
use fastbloom_rs::{BloomFilter, FilterBuilder};

let bloom = FilterBuilder::new(100_000_000, 0.01).build_bloom_filter();
let builder = bloom.config();
Source§

impl CountingBloomFilter

Source

pub fn from_u8_array( array: &[u8], hashes: u32, enable_repeat_insert: bool, ) -> Self

Source§

impl CountingBloomFilter

Source

pub fn from_u16_array( array: &[u16], hashes: u32, enable_repeat_insert: bool, ) -> Self

Source§

impl CountingBloomFilter

Source

pub fn from_u32_array( array: &[u32], hashes: u32, enable_repeat_insert: bool, ) -> Self

Source§

impl CountingBloomFilter

Source

pub fn from_u64_array( array: &[u64], hashes: u32, enable_repeat_insert: bool, ) -> Self

Source§

impl CountingBloomFilter

Source

pub fn estimate_count(&self, element: &[u8]) -> usize

Get the estimate count for element in this counting bloom filter. See: https://github.com/yankun1992/fastbloom/issues/3

Source

pub fn counter_at(&self, index: u64) -> usize

Get the underlying counter at index.

Trait Implementations§

Source§

impl Clone for CountingBloomFilter

Source§

fn clone(&self) -> CountingBloomFilter

Returns a duplicate of the value. Read more
1.0.0 · Source§

const fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CountingBloomFilter

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Deletable for CountingBloomFilter

Source§

fn remove(&mut self, element: &[u8])

remove element from this data structures.
Source§

impl Hashes for CountingBloomFilter

Source§

fn hashes(&self) -> u32

Source§

impl Membership for CountingBloomFilter

Source§

fn add(&mut self, element: &[u8])

Source§

fn contains(&self, element: &[u8]) -> bool

Source§

fn get_hash_indices(&self, element: &[u8]) -> Vec<u64>

Source§

fn contains_hash_indices(&self, indices: &Vec<u64>) -> bool

Source§

fn clear(&mut self)

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.