Struct cached::stores::SizedCache

source ·
pub struct SizedCache<K, V> { /* private fields */ }
Expand description

Least Recently Used / Sized Cache

Stores up to a specified size before beginning to evict the least recently used keys

Note: This cache is in-memory only

Implementations

👎Deprecated since 0.5.1: method renamed to with_size

Creates a new SizedCache with a given size limit and pre-allocated backing data

Return an iterator of keys in the current order from most to least recently used.

Trait Implementations

Attempt to retrieve a cached value
Insert a key, value pair
Remove a cached value
Remove all cached values
Return the current cache size (number of elements)
Return the number of times a cached value was successfully retrieved
Return the number of times a cached value was unable to be retrieved
Return the cache capacity
Return the lifespan of cached values (time to eviction)

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.