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

Aliased Type§

enum ShardedHashMap<K, V> {
    Single(Lock<HashMap<K, V, BuildHasherDefault<FxHasher>>>),
}

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) -> Kwhere K: Borrow<Q>, Q: Hash + Eq + ?Sized,

source

pub fn intern<Q>(&self, value: Q, make: impl FnOnce(Q) -> K) -> Kwhere 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

source§

impl<T> Sharded<T>

source

pub fn new(value: impl FnMut() -> T) -> Self

source

pub fn get_shard_by_value<K: Hash + ?Sized>(&self, _val: &K) -> &Lock<T>

The shard is selected by hashing val with FxHasher.

source

pub fn get_shard_by_hash(&self, hash: u64) -> &Lock<T>

source

pub fn get_shard_by_index(&self, _i: usize) -> &Lock<T>

source

pub fn lock_shard_by_value<K: Hash + ?Sized>( &self, _val: &K ) -> LockGuard<'_, T>

The shard is selected by hashing val with FxHasher.

source

pub fn lock_shard_by_hash(&self, hash: u64) -> LockGuard<'_, T>

source

pub fn lock_shard_by_index(&self, _i: usize) -> LockGuard<'_, T>

source

pub fn lock_shards(&self) -> impl Iterator<Item = LockGuard<'_, T>>

source

pub fn try_lock_shards(&self) -> impl Iterator<Item = Option<LockGuard<'_, T>>>

Trait Implementations§

source§

impl<T: Default> Default for Sharded<T>

source§

fn default() -> Self

Returns the “default value” for a type. Read more

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