pub struct LocalCache<K, V, H> { /* private fields */ }Expand description
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§
Source§impl<K, V, H> LocalCache<K, V, H>
impl<K, V, H> LocalCache<K, V, H>
Trait Implementations§
Auto Trait Implementations§
impl<K, V, H> !Freeze for LocalCache<K, V, H>
impl<K, V, H> !RefUnwindSafe for LocalCache<K, V, H>
impl<K, V, H> Send for LocalCache<K, V, H>
impl<K, V, H> !Sync for LocalCache<K, V, H>
impl<K, V, H> Unpin for LocalCache<K, V, H>
impl<K, V, H> UnwindSafe for LocalCache<K, V, H>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more