[][src]Struct cached::SizedCache

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

Note: This cache is in-memory only

Implementations

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

pub fn with_capacity(size: usize) -> SizedCache<K, V>[src]

👎 Deprecated since 0.5.1:

method renamed to with_size

pub fn with_size(size: usize) -> SizedCache<K, V>[src]

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

pub fn key_order(&self) -> impl Iterator<Item = &K>[src]

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

pub fn value_order(&self) -> impl Iterator<Item = &V>[src]

Return an iterator of values 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]

impl<K, V> CachedAsync<K, V> for SizedCache<K, V> where
    K: Hash + Eq + Clone + Send
[src]

impl<K: Clone, V: Clone> Clone for SizedCache<K, V>[src]

impl<K, V> Debug for SizedCache<K, V> where
    K: Debug,
    V: Debug
[src]

impl<K, V> Eq for SizedCache<K, V> where
    K: Eq + Hash + Clone,
    V: PartialEq
[src]

impl<K, V> PartialEq<SizedCache<K, V>> for SizedCache<K, V> where
    K: Eq + Hash + Clone,
    V: PartialEq
[src]

Auto Trait Implementations

impl<K, V> RefUnwindSafe for SizedCache<K, V> where
    K: RefUnwindSafe,
    V: RefUnwindSafe
[src]

impl<K, V> Send for SizedCache<K, V> where
    K: Send,
    V: Send
[src]

impl<K, V> Sync for SizedCache<K, V> where
    K: Sync,
    V: Sync
[src]

impl<K, V> Unpin for SizedCache<K, V> where
    K: Unpin,
    V: Unpin
[src]

impl<K, V> UnwindSafe for SizedCache<K, V> where
    K: UnwindSafe,
    V: UnwindSafe
[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.