pub struct Bloom { /* private fields */ }Expand description
The filter over a set of keys.
Implementations§
Source§impl Bloom
impl Bloom
Sourcepub fn build<K: AsRef<[u8]>>(keys: &[K], bits_per_key: usize) -> Self
pub fn build<K: AsRef<[u8]>>(keys: &[K], bits_per_key: usize) -> Self
A filter over keys at bits_per_key; at least one block.
Sourcepub fn contains(&self, key: &[u8]) -> bool
pub fn contains(&self, key: &[u8]) -> bool
Whether key may be in the set: never false for a key that is, true
for about 1 percent of keys that are not.
Sourcepub fn to_bytes(&self) -> Vec<u8> ⓘ
pub fn to_bytes(&self) -> Vec<u8> ⓘ
The filter as bytes: each word little-endian, blocks in order.
Sourcepub fn from_bytes(bytes: &[u8]) -> Result<Self>
pub fn from_bytes(bytes: &[u8]) -> Result<Self>
The filter to_bytes wrote; refused unless whole blocks, at least one.
Trait Implementations§
impl Eq for Bloom
impl StructuralPartialEq for Bloom
Auto Trait Implementations§
impl Freeze for Bloom
impl RefUnwindSafe for Bloom
impl Send for Bloom
impl Sync for Bloom
impl Unpin for Bloom
impl UnsafeUnpin for Bloom
impl UnwindSafe for Bloom
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