rustc_data_structures::sharded

Type Alias ShardedHashMap

Source
pub type ShardedHashMap<K, V> = Sharded<FxHashMap<K, V>>;

Aliased Type§

enum ShardedHashMap<K, V> {
    Single(Lock<HashMap<K, V, FxBuildHasher>>),
    Shards(Box<[CacheAligned<Lock<HashMap<K, V, FxBuildHasher>>>; 32]>),
}

Variants§

Implementations§

Source§

impl<K: Eq, V> ShardedHashMap<K, V>

Source

pub fn len(&self) -> usize

Source§

impl<K: Eq + Hash + Copy> ShardedHashMap<K, ()>

Source

pub fn intern_ref<Q>(&self, value: &Q, make: impl FnOnce() -> K) -> K
where K: Borrow<Q>, Q: Hash + Eq + ?Sized,

Source

pub fn intern<Q>(&self, value: Q, make: impl FnOnce(Q) -> K) -> K
where K: Borrow<Q>, Q: Hash + Eq,

Source§

impl<K: Eq + Hash + Copy + IntoPointer> ShardedHashMap<K, ()>

Source

pub fn contains_pointer_to<T: Hash + IntoPointer>(&self, value: &T) -> bool

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

Size for each variant:

  • Single: 40 bytes
  • Shards: 8 bytes