[−][src]Struct bloomfilter::Bloom
Bloom filter structure
Methods
impl<T: ?Sized> Bloom<T>
[src]
pub fn new(bitmap_size: usize, items_count: usize) -> Self
[src]
Create a new bloom filter structure. bitmap_size is the size in bytes (not bits) that will be allocated in memory items_count is an estimation of the maximum number of items to store.
pub fn new_for_fp_rate(items_count: usize, fp_p: f64) -> Self
[src]
Create a new bloom filter structure. items_count is an estimation of the maximum number of items to store. fp_p is the wanted rate of false positives, in ]0.0, 1.0[
pub fn from_existing(
bitmap: &[u8],
bitmap_bits: u64,
k_num: u32,
sip_keys: [(u64, u64); 2]
) -> Self
[src]
bitmap: &[u8],
bitmap_bits: u64,
k_num: u32,
sip_keys: [(u64, u64); 2]
) -> Self
Create a bloom filter structure with an existing state. The state is assumed to be retrieved from an existing bloom filter.
pub fn compute_bitmap_size(items_count: usize, fp_p: f64) -> usize
[src]
Compute a recommended bitmap size for items_count items and a fp_p rate of false positives. fp_p obviously has to be within the ]0.0, 1.0[ range.
pub fn set(&mut self, item: &T) where
T: Hash,
[src]
T: Hash,
Record the presence of an item.
pub fn check(&self, item: &T) -> bool where
T: Hash,
[src]
T: Hash,
Check if an item is present in the set. There can be false positives, but no false negatives.
pub fn check_and_set(&mut self, item: &T) -> bool where
T: Hash,
[src]
T: Hash,
Record the presence of an item in the set, and return the previous state of this item.
pub fn bitmap(&self) -> Vec<u8>
[src]
Return the bitmap as a vector of bytes
pub fn number_of_bits(&self) -> u64
[src]
Return the number of bits in the filter
pub fn number_of_hash_functions(&self) -> u32
[src]
Return the number of hash functions used for check
and set
pub fn sip_keys(&self) -> [(u64, u64); 2]
[src]
Return the keys used by the sip hasher
pub fn clear(&mut self)
[src]
Clear all of the bits in the filter, removing all keys from the set
Auto Trait Implementations
impl<T: ?Sized> RefUnwindSafe for Bloom<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T: ?Sized> Send for Bloom<T> where
T: Send,
T: Send,
impl<T: ?Sized> Sync for Bloom<T> where
T: Sync,
T: Sync,
impl<T: ?Sized> Unpin for Bloom<T> where
T: Unpin,
T: Unpin,
impl<T: ?Sized> UnwindSafe for Bloom<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,