pub struct StorageFilter { /* private fields */ }Expand description
StorageFilter filters entries based on multiple conditions for admission and reinsertion.
StorageFilter admits all entries if no conditions are set.
Implementations§
Source§impl StorageFilter
impl StorageFilter
Sourcepub fn with_condition<C: StorageFilterCondition>(self, condition: C) -> Self
pub fn with_condition<C: StorageFilterCondition>(self, condition: C) -> Self
Push a new condition to the filter.
Sourcepub fn filter(
&self,
stats: &Arc<Statistics>,
hash: u64,
estimated_size: usize,
) -> StorageFilterResult
pub fn filter( &self, stats: &Arc<Statistics>, hash: u64, estimated_size: usize, ) -> StorageFilterResult
Check if the entry can be admitted by the filter conditions.
Trait Implementations§
Source§impl Debug for StorageFilter
impl Debug for StorageFilter
Source§impl Default for StorageFilter
impl Default for StorageFilter
Source§fn default() -> StorageFilter
fn default() -> StorageFilter
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for StorageFilter
impl !RefUnwindSafe for StorageFilter
impl Send for StorageFilter
impl Sync for StorageFilter
impl Unpin for StorageFilter
impl !UnwindSafe for StorageFilter
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more