[][src]Struct golomb_set::UnpackedGcs

pub struct UnpackedGcs<D: Digest> { /* fields omitted */ }

An unpacked Golomb Coded Set.

Methods

impl<D: Digest> UnpackedGcs<D>[src]

pub fn new(n: usize, p: u8) -> Self[src]

Creates a new UnpackedGcs from n and p, where 1/2^p is the probability of a false positive when n items have been inserted into the set.

pub fn insert_from_reader<R: Read>(&mut self, reader: R) -> Result<(), Error>[src]

Copies data from the reader and inserts into into the set.

Errors

  • If there is an error reading data from reader.
  • If more than n items have been inserted.

pub fn insert<A: AsRef<[u8]>>(&mut self, input: A) -> Result<(), Error>[src]

Adds an entry to the set, and returns an error if more than N items are added.

Errors

  • If more than n items have been inserted.

pub fn contains<A: AsRef<[u8]>>(&self, input: A) -> bool[src]

Returns whether or not an input is contained in the set. If false the input is definitely not present, if true the input is probably present.

pub fn pack(&self) -> Gcs<D>[src]

Packs an UnpackedGcs into a Gcs.

This will will reduce the memory footprint, but also reduce query performance.

Trait Implementations

impl<D: PartialEq + Digest> PartialEq<UnpackedGcs<D>> for UnpackedGcs<D>[src]

impl<D: Clone + Digest> Clone for UnpackedGcs<D>[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl<D: Debug + Digest> Debug for UnpackedGcs<D>[src]

Auto Trait Implementations

impl<D> Send for UnpackedGcs<D> where
    D: Send

impl<D> Unpin for UnpackedGcs<D> where
    D: Unpin

impl<D> Sync for UnpackedGcs<D> where
    D: Sync

impl<D> UnwindSafe for UnpackedGcs<D> where
    D: UnwindSafe

impl<D> RefUnwindSafe for UnpackedGcs<D> where
    D: RefUnwindSafe

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.

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

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

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

impl<T> Same<T> for T

type Output = T

Should always be Self