pub struct ArcCache<K, V, S = RandomState>{ /* private fields */ }Implementations§
Source§impl<K, V, S> ArcCache<K, V, S>
impl<K, V, S> ArcCache<K, V, S>
Sourcepub fn with_hasher(
capacity: usize,
hash_builder: S,
) -> Result<Self, &'static str>where
S: Clone,
pub fn with_hasher(
capacity: usize,
hash_builder: S,
) -> Result<Self, &'static str>where
S: Clone,
Creates an empty cache that can hold at most capacity items with the given hash builder.
pub fn contains_key<Q>(&mut self, key: &Q) -> bool
pub fn insert(&mut self, key: K, value: V) -> bool
pub fn peek_mut(&mut self, key: &K) -> Option<&mut V>
pub fn get_mut(&mut self, key: &K) -> Option<&mut V>
pub fn remove(&mut self, key: &K) -> Option<V>
pub fn clear(&mut self)
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn frequent_len(&self) -> usize
pub fn recent_len(&self) -> usize
pub fn inserted(&self) -> u64
pub fn evicted(&self) -> u64
pub fn removed(&self) -> u64
Trait Implementations§
Source§impl<'a, K, V, S> IntoIterator for &'a ArcCache<K, V, S>
impl<'a, K, V, S> IntoIterator for &'a ArcCache<K, V, S>
Auto Trait Implementations§
impl<K, V, S> Freeze for ArcCache<K, V, S>where
S: Freeze,
impl<K, V, S> RefUnwindSafe for ArcCache<K, V, S>
impl<K, V, S> Send for ArcCache<K, V, S>
impl<K, V, S> Sync for ArcCache<K, V, S>
impl<K, V, S> Unpin for ArcCache<K, V, S>where
S: Unpin,
impl<K, V, S> UnwindSafe for ArcCache<K, V, S>
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