pub struct DegradationCache<T: Clone> { /* private fields */ }Implementations§
Source§impl<T: Clone> DegradationCache<T>
impl<T: Clone> DegradationCache<T>
pub fn new(max_stale: Duration) -> Self
pub fn store(&self, key: &str, value: T)
pub fn get_fresh(&self, key: &str) -> Option<T>
pub fn get_stale(&self, key: &str) -> Option<T>
pub fn is_stale(&self, key: &str) -> bool
pub fn entry_count(&self) -> usize
pub fn evict_stale(&self) -> usize
Auto Trait Implementations§
impl<T> !Freeze for DegradationCache<T>
impl<T> RefUnwindSafe for DegradationCache<T>
impl<T> Send for DegradationCache<T>where
T: Send,
impl<T> Sync for DegradationCache<T>where
T: Send,
impl<T> Unpin for DegradationCache<T>where
T: Unpin,
impl<T> UnsafeUnpin for DegradationCache<T>
impl<T> UnwindSafe for DegradationCache<T>
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