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;
}
Expand description

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

Returns a string identifying this policy.

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.

Check whether the given key may match the filter.

Implementations on Foreign Types

Implementors