Struct network_collections::least_recently_used_cache::LeastRecentlyUsedCacheWithExpiry [−][src]
A least recently used cache with expiry of items.
Expiry is only checked on access.
Methods
impl<K: Eq + Hash, V> LeastRecentlyUsedCacheWithExpiry<K, V>
[src]
impl<K: Eq + Hash, V> LeastRecentlyUsedCacheWithExpiry<K, V>
pub fn new(maximum_capacity: usize, expiry_period: MillisecondDuration) -> Self
[src]
pub fn new(maximum_capacity: usize, expiry_period: MillisecondDuration) -> Self
The expiry_period
can be zero; entries are considered to be expired when this is exceeded.
pub fn get(&mut self, now: MonotonicMillisecondTimestamp, key: &K) -> Option<&V>
[src]
pub fn get(&mut self, now: MonotonicMillisecondTimestamp, key: &K) -> Option<&V>
Gets a value.
pub fn get_mut(
&mut self,
now: MonotonicMillisecondTimestamp,
key: &K
) -> Option<&mut V>
[src]
pub fn get_mut(
&mut self,
now: MonotonicMillisecondTimestamp,
key: &K
) -> Option<&mut V>
Gets a value that can be mutated.
pub fn insert(&mut self, now: MonotonicMillisecondTimestamp, key: K, value: V)
[src]
pub fn insert(&mut self, now: MonotonicMillisecondTimestamp, key: K, value: V)
Insert an item.
Trait Implementations
Auto Trait Implementations
impl<K, V> !Send for LeastRecentlyUsedCacheWithExpiry<K, V>
impl<K, V> !Send for LeastRecentlyUsedCacheWithExpiry<K, V>
impl<K, V> !Sync for LeastRecentlyUsedCacheWithExpiry<K, V>
impl<K, V> !Sync for LeastRecentlyUsedCacheWithExpiry<K, V>