pub struct TtlCache<K, V> {
cache: HashMap<K, (V, Instant)>,
ttl: Duration,
}
Expand description
A TTL cache
Fields§
§cache: HashMap<K, (V, Instant)>
§ttl: Duration
Implementations§
Auto Trait Implementations§
impl<K, V> Freeze for TtlCache<K, V>
impl<K, V> RefUnwindSafe for TtlCache<K, V>where
K: RefUnwindSafe,
V: RefUnwindSafe,
impl<K, V> Send for TtlCache<K, V>
impl<K, V> Sync for TtlCache<K, V>
impl<K, V> Unpin for TtlCache<K, V>
impl<K, V> UnwindSafe for TtlCache<K, V>where
K: UnwindSafe,
V: UnwindSafe,
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