pub trait BloomProvider<Key: Send + Sync>: Sync + Send {
    type Filter: FilterTrait<Key>;

    // Required methods
    fn check_filter<'life0, 'life1, 'async_trait>(
        &'life0 self,
        item: &'life1 Key
    ) -> Pin<Box<dyn Future<Output = FilterResult> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn check_filter_fast(&self, item: &Key) -> FilterResult;
    fn offload_buffer<'life0, 'async_trait>(
        &'life0 mut self,
        needed_memory: usize,
        level: usize
    ) -> Pin<Box<dyn Future<Output = usize> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_filter<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Option<Self::Filter>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_filter_fast(&self) -> Option<&Self::Filter>;
    fn filter_memory_allocated<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = usize> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Trait for scructs which contains bloom filters

Required Associated Types§

source

type Filter: FilterTrait<Key>

Inner filter type

Required Methods§

source

fn check_filter<'life0, 'life1, 'async_trait>( &'life0 self, item: &'life1 Key ) -> Pin<Box<dyn Future<Output = FilterResult> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Check if element in filter

source

fn check_filter_fast(&self, item: &Key) -> FilterResult

Check if element in filter

source

fn offload_buffer<'life0, 'async_trait>( &'life0 mut self, needed_memory: usize, level: usize ) -> Pin<Box<dyn Future<Output = usize> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Returns freed memory

source

fn get_filter<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Option<Self::Filter>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Returns overall filter

source

fn get_filter_fast(&self) -> Option<&Self::Filter>

Returns overall filter

source

fn filter_memory_allocated<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = usize> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Returns allocated memory

Implementors§

source§

impl<K> BloomProvider<K> for Storage<K>where for<'a> K: Key<'a> + 'static,

§

type Filter = <Blob<K> as BloomProvider<K>>::Filter

source§

impl<Key, Filter, Child> BloomProvider<Key> for HierarchicalFilters<Key, Filter, Child>where Key: Sync + Send, Child: BloomProvider<Key>, Filter: FilterTrait<Key>,

§

type Filter = Filter