Type Alias rustc_data_structures::sharded::ShardedHashMap
source · pub type ShardedHashMap<K, V> = Sharded<FxHashMap<K, V>>;
Aliased Type§
enum ShardedHashMap<K, V> {
Single(Lock<HashMap<K, V, BuildHasherDefault<FxHasher>>>),
}
Variants§
Single(Lock<HashMap<K, V, BuildHasherDefault<FxHasher>>>)
Implementations§
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
source§impl<T> Sharded<T>
impl<T> Sharded<T>
pub fn new(value: impl FnMut() -> T) -> Self
sourcepub fn get_shard_by_value<K: Hash + ?Sized>(&self, _val: &K) -> &Lock<T>
pub fn get_shard_by_value<K: Hash + ?Sized>(&self, _val: &K) -> &Lock<T>
The shard is selected by hashing val
with FxHasher
.
pub fn get_shard_by_hash(&self, hash: u64) -> &Lock<T>
pub fn get_shard_by_index(&self, _i: usize) -> &Lock<T>
sourcepub fn lock_shard_by_value<K: Hash + ?Sized>(
&self,
_val: &K
) -> LockGuard<'_, T>
pub fn lock_shard_by_value<K: Hash + ?Sized>( &self, _val: &K ) -> LockGuard<'_, T>
The shard is selected by hashing val
with FxHasher
.
pub fn lock_shard_by_hash(&self, hash: u64) -> LockGuard<'_, T>
pub fn lock_shard_by_index(&self, _i: usize) -> LockGuard<'_, T>
pub fn lock_shards(&self) -> impl Iterator<Item = LockGuard<'_, T>>
pub fn try_lock_shards(&self) -> impl Iterator<Item = Option<LockGuard<'_, T>>>
Trait Implementations§
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 40 bytes