Struct cached::stores::SizedCache[][src]

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

Least Recently Used / Sized Cache

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

Methods

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

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

impl<K: Hash + Eq + Clone, V> Cached<K, V> for SizedCache<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 cache capacity

Return the lifespan of cached values (time to eviction)

Auto Trait Implementations

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

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