[][src]Struct rust_cascade::Cascade

pub struct Cascade<'a> { /* fields omitted */ }

A multi-level cascading Bloom filter.

Methods

impl<'a> Cascade<'a>[src]

pub fn from_bytes(bytes: &'a [u8]) -> Result<Option<Box<Cascade<'a>>>, Error>[src]

Attempts to decode and return a multi-level cascading Bloom filter. NB: Cascade does not take ownership of the given data. This is to facilitate decoding cascading filters backed by memory-mapped files.

Arguments

bytes - The encoded representation of the Bloom filters in this cascade. Starts with 2 little endian bytes indicating the version. The current version is 2. The Python filter-cascade project defines the formats, see https://github.com/mozilla/filter-cascade/blob/v0.3.0/filtercascade/fileformats.py

May be of length 0, in which case None is returned.

pub fn has(&self, entry: &[u8]) -> bool[src]

Determine if the given sequence of bytes is in the cascade.

Arguments

entry - The slice of bytes to test for

pub fn has_internal(&self, entry: &[u8]) -> bool[src]

Trait Implementations

impl<'a> Display for Cascade<'a>[src]

Auto Trait Implementations

impl<'a> RefUnwindSafe for Cascade<'a>

impl<'a> Send for Cascade<'a>

impl<'a> Sync for Cascade<'a>

impl<'a> Unpin for Cascade<'a>

impl<'a> UnwindSafe for Cascade<'a>

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> Same<T> for T

type Output = T

Should always be Self

impl<T> ToString for T where
    T: Display + ?Sized
[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.