pub struct FastFixedCache<K, V> { /* private fields */ }
Implementations§
Source§impl<K: Hash + Eq, V> FastFixedCache<K, V>
impl<K: Hash + Eq, V> FastFixedCache<K, V>
pub fn new(n: usize) -> Self
pub fn get<Q: Hash + Eq + ?Sized>(&self, key: &Q) -> Option<&V>where
K: Borrow<Q>,
pub fn get_mut<Q: Hash + Eq + ?Sized>(&mut self, key: &Q) -> Option<&mut V>where
K: Borrow<Q>,
pub fn insert(&mut self, key: K, value: V) -> &mut V
pub fn get_or_insert_with<Q, F>(&mut self, key: &Q, f: F) -> &mut V
pub fn try_get_or_insert_with<Q, F, E>( &mut self, key: &Q, f: F, ) -> Result<&mut V, E>
Trait Implementations§
Source§impl<K: Clone, V: Clone> Clone for FastFixedCache<K, V>
impl<K: Clone, V: Clone> Clone for FastFixedCache<K, V>
Source§fn clone(&self) -> FastFixedCache<K, V>
fn clone(&self) -> FastFixedCache<K, V>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl<K, V> !Freeze for FastFixedCache<K, V>
impl<K, V> !RefUnwindSafe for FastFixedCache<K, V>
impl<K, V> Send for FastFixedCache<K, V>
impl<K, V> !Sync for FastFixedCache<K, V>
impl<K, V> Unpin for FastFixedCache<K, V>
impl<K, V> UnwindSafe for FastFixedCache<K, V>where
K: UnwindSafe,
V: 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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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