Struct cached::stores::TimedCache[][src]

pub struct TimedCache<K, V> { /* fields omitted */ }

Cache store bound by time

Values are timestamped when inserted and are expired on attempted retrieval.

Methods

impl<K: Hash + Eq, V> TimedCache<K, V>
[src]

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

impl<K: Hash + Eq, V> Cached<K, V> for TimedCache<K, V>
[src]

Attempt to retrieve a cached value

Insert a key, value pair

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

impl<K, V> Send for TimedCache<K, V> where
    K: Send,
    V: Send

impl<K, V> Sync for TimedCache<K, V> where
    K: Sync,
    V: Sync