Trait mkit::db::Bloom [−][src]
Trait to build and manage keys in a bit-mapped Bloom-filter.
Associated Types
Loading content...Required methods
fn add_key<Q: ?Sized + Hash>(&mut self, key: &Q)
[src]
Add key into the index.
fn add_digest32(&mut self, digest: u32)
[src]
Add key into the index.
fn build(&mut self)
[src]
Build keys, added so far via add_key
and add_digest32
into the
bitmap index. Useful for types that support batch building and
immutable bitmap index.
fn contains<Q: ?Sized + Hash>(&self, element: &Q) -> bool
[src]
Check whether key in present, there can be false positives but no false negatives.
fn to_bytes(&self) -> Result<Vec<u8>, Self::Err>
[src]
Serialize the bit-map to binary array.
fn from_bytes(buf: &[u8]) -> Result<(Self, usize), Self::Err>
[src]
Deserialize the binary array to bit-map.
fn or(&self, other: &Self) -> Result<Self, Self::Err>
[src]
Merge two bitmaps.
Implementations on Foreign Types
impl<H> Bloom for Xor8<H> where
H: Default + BuildHasher + From<Vec<u8>> + Into<Vec<u8>> + Clone,
[src]
H: Default + BuildHasher + From<Vec<u8>> + Into<Vec<u8>> + Clone,
type Err = Error
fn add_key<Q: ?Sized + Hash>(&mut self, key: &Q)
[src]
fn add_digest32(&mut self, digest: u32)
[src]
fn build(&mut self)
[src]
fn contains<Q: ?Sized + Hash>(&self, element: &Q) -> bool
[src]
fn to_bytes(&self) -> Result<Vec<u8>, Self::Err>
[src]
fn from_bytes(buf: &[u8]) -> Result<(Self, usize), Self::Err>
[src]
fn or(&self, _other: &Self) -> Result<Self, Self::Err>
[src]
Implementors
impl Bloom for NoBitmap
[src]
type Err = Infallible
fn add_key<Q: ?Sized + Hash>(&mut self, _key: &Q)
[src]
fn add_digest32(&mut self, _digest: u32)
[src]
fn build(&mut self)
[src]
fn contains<Q: ?Sized + Hash>(&self, _element: &Q) -> bool
[src]
fn to_bytes(&self) -> Result<Vec<u8>, Self::Err>
[src]
fn from_bytes(_buf: &[u8]) -> Result<(Self, usize), Self::Err>
[src]
Deserialize the binary array to bit-map.
fn or(&self, _other: &Self) -> Result<Self, Self::Err>
[src]
Merge two bitmaps.