pub struct DashCache<C, S = RandomState> { /* private fields */ }Expand description
A global cache built around a DashMap
Implementations§
Trait Implementations§
Source§impl<C, S> GlobalCache for DashCache<C, S>
impl<C, S> GlobalCache for DashCache<C, S>
Source§fn cache<Q>(&self, value: Q) -> C
fn cache<Q>(&self, value: Q) -> C
Attempt to cache a value. If already cached, return the corresponding entry. Read more
Source§fn gc(&self) -> usize
fn gc(&self) -> usize
Attempt to garbage-collect this cache, returning how many elements were removed. Read more
Source§fn try_gc(&self, key: &mut Self::Entry) -> Option<Self::Entry>
fn try_gc(&self, key: &mut Self::Entry) -> Option<Self::Entry>
Garbage collect a single entry if doing so would not break the hash-consing property due to uniqueness.
Returns the removed key on success, or Err(key) on failure Read more
Auto Trait Implementations§
impl<C, S> Freeze for DashCache<C, S>where
S: Freeze,
impl<C, S = RandomState> !RefUnwindSafe for DashCache<C, S>
impl<C, S> Send for DashCache<C, S>
impl<C, S> Sync for DashCache<C, S>
impl<C, S> Unpin for DashCache<C, S>where
S: Unpin,
impl<C, S> UnwindSafe for DashCache<C, S>where
S: UnwindSafe,
C: UnwindSafe,
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
Source§impl<T> Erasable for T
impl<T> Erasable for T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more