pub type ShardedHashMap<K, V> = Sharded<HashTable<(K, V)>>;Aliased Type§
pub enum ShardedHashMap<K, V> {
Single(Lock<HashTable<(K, V)>>),
Shards(Box<[CacheAligned<Lock<HashTable<(K, V)>>>; 32]>),
}Variants§
Implementations§
Source§impl<K: Eq, V> ShardedHashMap<K, V>
impl<K: Eq, V> ShardedHashMap<K, V>
Source§impl<K: Eq + Hash, V> ShardedHashMap<K, V>
impl<K: Eq + Hash, V> ShardedHashMap<K, V>
pub fn get<Q>(&self, key: &Q) -> Option<V>
pub fn get_or_insert_with(&self, key: K, default: impl FnOnce() -> V) -> Vwhere
V: Copy,
Sourcepub fn insert_unique(&self, key: K, value: V)
pub fn insert_unique(&self, key: K, value: V)
Insert value into the ShardedHashMap with unique key.
This function panics if debug_assertions are enabled and uniqueness is violated. If uniqueness is violated but debug_assertions are disabled then lookups will arbitrarily return one of the inserted elements.
Source§impl<K: Eq + Hash + Copy + IntoPointer> ShardedHashMap<K, ()>
impl<K: Eq + Hash + Copy + IntoPointer> ShardedHashMap<K, ()>
pub fn contains_pointer_to<T: Hash + IntoPointer>(&self, value: &T) -> bool
Layout§
Note: Unable to compute type layout, possibly due to this type having generic parameters. Layout can only be computed for concrete, fully-instantiated types.