[][src]Struct compressible_map::LocalCache

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

When immutable cache access is required, use this LocalCache to store evicted values. Then when you get mutable cache access, call into_iter to update the cache manually.

This cache comes with a price: the values will be boxed in order to provide stable borrows. Ideally, it should be cheap to box your values, i.e. most of their data should already be on the heap.

Implementations

impl<K, V, H> LocalCache<K, V, H> where
    K: Eq + Hash,
    H: Default + BuildHasher
[src]

pub fn new() -> Self[src]

pub fn remember_cached_access(&self, key: K)[src]

pub fn get_or_insert_with(&self, key: K, f: impl FnOnce() -> V) -> &V[src]

pub fn into_iter(self) -> impl Iterator<Item = (K, LocalAccess<V>)>[src]

Trait Implementations

impl<K: Default, V: Default, H: Default> Default for LocalCache<K, V, H>[src]

Auto Trait Implementations

impl<K, V, H> !RefUnwindSafe for LocalCache<K, V, H>

impl<K, V, H> Send for LocalCache<K, V, H> where
    H: Send,
    K: Send,
    V: Send

impl<K, V, H> !Sync for LocalCache<K, V, H>

impl<K, V, H> Unpin for LocalCache<K, V, H> where
    H: Unpin,
    K: Unpin

impl<K, V, H> UnwindSafe for LocalCache<K, V, H> where
    H: UnwindSafe,
    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.