pub struct LruCache<K, V> { /* private fields */ }Implementations§
Source§impl<K: Eq + Hash, V> LruCache<K, V>
impl<K: Eq + Hash, V> LruCache<K, V>
pub fn new(cap: NonZeroUsize) -> Self
pub fn scope<'cache, F, R>(&'cache mut self, fun: F) -> R
pub fn put(&mut self, k: K, v: V) -> Option<V>
pub fn get<'cache>(&'cache mut self, k: &K) -> Option<&'cache V>
pub fn peek_mut<'cache>(&'cache mut self, k: &K) -> Option<&'cache mut V>
Trait Implementations§
Auto Trait Implementations§
impl<K, V> Freeze for LruCache<K, V>
impl<K, V> RefUnwindSafe for LruCache<K, V>where
K: RefUnwindSafe,
V: RefUnwindSafe,
impl<K, V> !Send for LruCache<K, V>
impl<K, V> !Sync for LruCache<K, V>
impl<K, V> Unpin for LruCache<K, V>
impl<K, V> UnwindSafe for LruCache<K, V>where
K: RefUnwindSafe,
V: RefUnwindSafe,
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