pub struct PrunePolicy { /* private fields */ }Expand description
Size, count, and age policy for cache pruning.
Implementations§
Source§impl PrunePolicy
impl PrunePolicy
Sourcepub const fn max_entries(self, limit: EntryLimit) -> Self
pub const fn max_entries(self, limit: EntryLimit) -> Self
Adds a maximum entry count.
Sourcepub const fn max_unused_age(self, age: Duration) -> Self
pub const fn max_unused_age(self, age: Duration) -> Self
Removes entries unused for at least age, even below capacity.
Sourcepub const fn byte_limit(self) -> ByteLimit
pub const fn byte_limit(self) -> ByteLimit
Returns the high byte watermark.
Sourcepub const fn entry_limit(self) -> Option<EntryLimit>
pub const fn entry_limit(self) -> Option<EntryLimit>
Returns the optional high entry watermark.
Sourcepub const fn unused_age(self) -> Option<Duration>
pub const fn unused_age(self) -> Option<Duration>
Returns the optional maximum unused age.
Trait Implementations§
Source§impl Clone for PrunePolicy
impl Clone for PrunePolicy
Source§fn clone(&self) -> PrunePolicy
fn clone(&self) -> PrunePolicy
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for PrunePolicy
Source§impl Debug for PrunePolicy
impl Debug for PrunePolicy
impl Eq for PrunePolicy
Source§impl PartialEq for PrunePolicy
impl PartialEq for PrunePolicy
Source§fn eq(&self, other: &PrunePolicy) -> bool
fn eq(&self, other: &PrunePolicy) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for PrunePolicy
Auto Trait Implementations§
impl Freeze for PrunePolicy
impl RefUnwindSafe for PrunePolicy
impl Send for PrunePolicy
impl Sync for PrunePolicy
impl Unpin for PrunePolicy
impl UnsafeUnpin for PrunePolicy
impl UnwindSafe for PrunePolicy
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more