[][src]Struct cached::stores::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, 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]

Auto Trait Implementations

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

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

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

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

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, 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.