Struct poly_commitment::hash_map_cache::HashMapCache
source · pub struct HashMapCache<Key: Hash, Value> { /* private fields */ }
Implementations§
source§impl<Key: Hash + Eq, Value> HashMapCache<Key, Value>
impl<Key: Hash + Eq, Value> HashMapCache<Key, Value>
pub fn new() -> Self
pub fn new_from_hashmap(hashmap: HashMap<Key, Value>) -> Self
pub fn get_or_generate<F: FnOnce() -> Value>( &self, key: Key, generator: F ) -> &Value
pub fn contains_key(&self, key: &Key) -> bool
Trait Implementations§
source§impl<Key: Clone + Hash, Value: Clone> Clone for HashMapCache<Key, Value>
impl<Key: Clone + Hash, Value: Clone> Clone for HashMapCache<Key, Value>
source§fn clone(&self) -> HashMapCache<Key, Value>
fn clone(&self) -> HashMapCache<Key, Value>
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<Key, Value> RefUnwindSafe for HashMapCache<Key, Value>
impl<Key, Value> Send for HashMapCache<Key, Value>where Key: Send, Value: Send,
impl<Key, Value> Sync for HashMapCache<Key, Value>where Key: Send, Value: Send,
impl<Key, Value> Unpin for HashMapCache<Key, Value>
impl<Key, Value> UnwindSafe for HashMapCache<Key, Value>
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