Struct cached::stores::TimedCache

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

Cache store bound by time

Values are timestamped when inserted and are evicted if expired at time of retrieval.

Note: This cache is in-memory only

Implementations

Creates a new TimedCache with a specified lifespan

Creates a new TimedCache with a specified lifespan and cache-store with the specified pre-allocated capacity

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 lifespan of cached values (time to eviction)
Return the cache capacity

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.