[][src]Struct xorfilter::Xor8

pub struct Xor8<H = RandomState> where
    H: BuildHasher
{ /* fields omitted */ }

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]

pub fn new() -> Self[src]

New Xor8 instance initialized with DefaulHasher.

impl<H> Xor8<H> where
    H: BuildHasher
[src]

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]

fn default() -> Self[src]

New Xor8 instance initialized with DefaulHasher.

impl<H> PartialEq<Xor8<H>> for Xor8<H> where
    H: BuildHasher
[src]

Auto Trait Implementations

impl<H> RefUnwindSafe for Xor8<H> where
    H: RefUnwindSafe

impl<H> Send for Xor8<H> where
    H: Send

impl<H> Sync for Xor8<H> where
    H: Sync

impl<H> Unpin for Xor8<H> where
    H: Unpin

impl<H> UnwindSafe for Xor8<H> where
    H: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.