Type Alias ShardedHashMap

Source
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>

Source

pub fn with_capacity(cap: usize) -> Self

Source

pub fn len(&self) -> usize

Source§

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

Source

pub fn get<Q>(&self, key: &Q) -> Option<V>
where K: Borrow<Q>, Q: Hash + Eq, V: Clone,

Source

pub fn get_or_insert_with(&self, key: K, default: impl FnOnce() -> V) -> V
where V: Copy,

Source

pub fn insert(&self, key: K, value: V) -> Option<V>

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: Unable to compute type layout, possibly due to this type having generic parameters. Layout can only be computed for concrete, fully-instantiated types.