pub struct CachePolicy { /* private fields */ }Expand description
Cache eviction policy tracker.
Implementations§
Source§impl CachePolicy
impl CachePolicy
pub fn new(kind: PolicyKind) -> Self
pub fn insert(&mut self, key: &str)
pub fn touch(&mut self, key: &str)
pub fn evict_candidate(&self) -> Option<&str>
pub fn remove(&mut self, key: &str)
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn kind(&self) -> PolicyKind
pub fn contains(&self, key: &str) -> bool
pub fn clear(&mut self)
Trait Implementations§
Source§impl Clone for CachePolicy
impl Clone for CachePolicy
Source§fn clone(&self) -> CachePolicy
fn clone(&self) -> CachePolicy
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for CachePolicy
impl RefUnwindSafe for CachePolicy
impl Send for CachePolicy
impl Sync for CachePolicy
impl Unpin for CachePolicy
impl UnsafeUnpin for CachePolicy
impl UnwindSafe for CachePolicy
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