Trait pearl::filter::traits::FilterTrait [−][src]
pub trait FilterTrait<Key: Send + Sync>: Clone + Sync + Send {
fn add(&mut self, key: &Key);
fn contains_fast(&self, key: &Key) -> FilterResult;
fn checked_add_assign(&mut self, other: &Self) -> bool;
fn contains<'life0, 'life1, 'life2, 'async_trait, P: BloomDataProvider>(
&'life0 self,
_provider: &'life1 P,
key: &'life2 Key
) -> Pin<Box<dyn Future<Output = FilterResult> + Send + 'async_trait>>
where
P: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
{ ... }
fn offload_filter(&mut self) -> usize { ... }
fn memory_allocated(&self) -> usize { ... }
}
Expand description
Trait filters should implement
Required methods
fn contains_fast(&self, key: &Key) -> FilterResult
fn contains_fast(&self, key: &Key) -> FilterResult
Check if key in filter (should be implemented if filter can be checked without waiting)
fn checked_add_assign(&mut self, other: &Self) -> bool
fn checked_add_assign(&mut self, other: &Self) -> bool
Add another filter to this filter
Provided methods
fn contains<'life0, 'life1, 'life2, 'async_trait, P: BloomDataProvider>(
&'life0 self,
_provider: &'life1 P,
key: &'life2 Key
) -> Pin<Box<dyn Future<Output = FilterResult> + Send + 'async_trait>> where
P: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn contains<'life0, 'life1, 'life2, 'async_trait, P: BloomDataProvider>(
&'life0 self,
_provider: &'life1 P,
key: &'life2 Key
) -> Pin<Box<dyn Future<Output = FilterResult> + Send + 'async_trait>> where
P: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Check if key in filter (can take some time)
fn offload_filter(&mut self) -> usize
fn offload_filter(&mut self) -> usize
Offload filter from memory if possible
fn memory_allocated(&self) -> usize
fn memory_allocated(&self) -> usize
Memory used by filter