Struct HashMapCache
pub struct HashMapCache<T: Clone> { /* private fields */ }
Expand description
A type that caches results in a HashMap
.
Implementations§
§impl<T: Clone> HashMapCache<T>
impl<T: Clone> HashMapCache<T>
pub fn new() -> Self
pub fn insert(&self, instruction: Instruction, item: T)
Trait Implementations§
§impl<T: Clone> Cache<T> for HashMapCache<T>
impl<T: Clone> Cache<T> for HashMapCache<T>
fn get_or_insert_with( &self, instruction: &Instruction, f: impl FnOnce(&Instruction) -> T, ) -> T
fn num_entries(&self) -> usize
Auto Trait Implementations§
impl<T> !Freeze for HashMapCache<T>
impl<T> RefUnwindSafe for HashMapCache<T>
impl<T> Send for HashMapCache<T>where
T: Send,
impl<T> Sync for HashMapCache<T>where
T: Send,
impl<T> Unpin for HashMapCache<T>where
T: Unpin,
impl<T> UnwindSafe for HashMapCache<T>
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, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
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