[−][src]Struct xorfilter::Xor8
Type Xor8 is probabilistic data-structure to test membership of an element in a set.
This implementation has a false positive rate of about 0.3% and a memory usage of less than 9 bits per entry for sizeable sets.
Methods
impl Xor8<RandomState>
[src]
impl<H> Xor8<H> where
H: BuildHasher,
[src]
H: BuildHasher,
pub fn with_hasher(hash_builder: H) -> Self
[src]
New Xor8 instance initialized with supplied hasher
.
pub fn insert<T: Hash>(&mut self, key: &T)
[src]
Insert 64-bit digest of a single key. Digest for the key shall be generated using the default-hasher or via hasher supplied via [new_hasher] method.
pub fn populate<T: Hash>(&mut self, keys: &[T])
[src]
Populate 64-bit digests for collection of keys. Digest for the key shall be generated using the default-hasher or via hasher supplied via [new_hasher] method.
pub fn populate_keys(&mut self, keys: &[u64])
[src]
Populate pre-compute 64-bit digests for keys.
pub fn build(&mut self)
[src]
Build bitmap for keys that are insert using [insert] or [populate] method.
pub fn build_keys(&mut self, keys: &[u64])
[src]
Build a bitmap for pre-computed 64-bit digests for keys. If any keys where inserted using [insert], [populate], [populate_keys] method shall be ignored.
pub fn contains<T: Hash>(&self, key: T) -> bool
[src]
Contains tell you whether the key is likely part of the set.
pub fn contains_key(&self, key: u64) -> bool
[src]
impl Xor8
[src]
pub fn write_file(&self, path: &str) -> Result<usize>
[src]
Write to file in binary format TODO Add chechsum of finger_prints into file headers
pub fn read_file(path: &str) -> Result<Self>
[src]
Read from file in binary format
Trait Implementations
impl Default for Xor8<RandomState>
[src]
impl<H> PartialEq<Xor8<H>> for Xor8<H> where
H: BuildHasher,
[src]
H: BuildHasher,
Auto Trait Implementations
impl<H> RefUnwindSafe for Xor8<H> where
H: RefUnwindSafe,
H: RefUnwindSafe,
impl<H> Send for Xor8<H> where
H: Send,
H: Send,
impl<H> Sync for Xor8<H> where
H: Sync,
H: Sync,
impl<H> Unpin for Xor8<H> where
H: Unpin,
H: Unpin,
impl<H> UnwindSafe for Xor8<H> where
H: UnwindSafe,
H: 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>,