[][src]Trait rusty_leveldb::FilterPolicy

pub trait FilterPolicy {
    fn name(&self) -> &'static str;
fn create_filter(&self, keys: &[u8], key_offsets: &[usize]) -> Vec<u8>;
fn key_may_match(&self, key: &[u8], filter: &[u8]) -> bool; }

Encapsulates a filter algorithm allowing to search for keys more efficiently. Usually, policies are used as a BoxedFilterPolicy (see below), so they can be easily cloned and nested.

Required methods

fn name(&self) -> &'static str

Returns a string identifying this policy.

fn create_filter(&self, keys: &[u8], key_offsets: &[usize]) -> Vec<u8>

Create a filter matching the given keys. Keys are given as a long byte array that is indexed by the offsets contained in key_offsets.

fn key_may_match(&self, key: &[u8], filter: &[u8]) -> bool

Check whether the given key may match the filter.

Loading content...

Implementations on Foreign Types

impl FilterPolicy for Rc<Box<dyn FilterPolicy>>[src]

Loading content...

Implementors

impl FilterPolicy for BloomPolicy[src]

Loading content...