pub struct Bloom64(pub u64);Expand description
64-bit Bloom filter with 4 hash functions.
Capacity for ~8 distinct keys at ~3% false-positive rate. Beyond that the filter saturates and FPR climbs rapidly.
Tuple Fields§
§0: u64Implementations§
Source§impl Bloom64
impl Bloom64
pub const ZERO: Self
Sourcepub const SUGGESTED_CAPACITY: usize = 8
pub const SUGGESTED_CAPACITY: usize = 8
Suggested capacity: ~8 keys before FPR climbs past ~3%. (64 bits / 4 hashes / 8 keys -> ~2.4% FPR; at 16 keys FPR is already ~16%.)
Sourcepub fn might_contain<K: Hash + ?Sized>(&self, key: &K) -> bool
pub fn might_contain<K: Hash + ?Sized>(&self, key: &K) -> bool
Probabilistic membership: returns false when key is
definitely-not-present, true when key might-be-present.
Sourcepub fn popcount(&self) -> u32
pub fn popcount(&self) -> u32
Number of set bits (informational; high values suggest saturation).
Sourcepub fn estimated_fpr(n: usize) -> f64
pub fn estimated_fpr(n: usize) -> f64
Approximate false-positive rate assuming n keys inserted.
Trait Implementations§
impl Copy for Bloom64
impl Eq for Bloom64
impl StructuralPartialEq for Bloom64
Auto Trait Implementations§
impl Freeze for Bloom64
impl RefUnwindSafe for Bloom64
impl Send for Bloom64
impl Sync for Bloom64
impl Unpin for Bloom64
impl UnsafeUnpin for Bloom64
impl UnwindSafe for Bloom64
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more