pub struct TtlCache { /* private fields */ }Expand description
A small in-memory TTL cache with best-effort LRU eviction.
This is intentionally simple: it is a safety/performance primitive, not a general-purpose cache.
Implementations§
Source§impl TtlCache
impl TtlCache
pub fn new(max_bytes: usize) -> Self
pub fn get_guard_result(&self, key: &str) -> Option<GuardResult>
pub fn set_guard_result(&self, key: String, value: &GuardResult, ttl: Duration)
Auto Trait Implementations§
impl !Freeze for TtlCache
impl !RefUnwindSafe for TtlCache
impl Send for TtlCache
impl Sync for TtlCache
impl Unpin for TtlCache
impl UnsafeUnpin for TtlCache
impl UnwindSafe for TtlCache
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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