saluki_common/
collections.rs

1use crate::hash::{FastBuildHasher, NoopU64BuildHasher};
2
3/// A hash set based on the standard library's ([`HashSet`][std::collections::HashSet]) using [`FastHasher`][crate::hash::FastHasher].
4pub type FastHashSet<T> = std::collections::HashSet<T, FastBuildHasher>;
5
6/// A hash map based on the standard library's ([`HashMap`][std::collections::HashMap]) using [`FastHasher`][crate::hash::FastHasher].
7pub type FastHashMap<K, V> = std::collections::HashMap<K, V, FastBuildHasher>;
8
9/// A concurrent hash set based on `papaya` ([`HashSet`][papaya::HashSet]) using [`FastHasher`][crate::hash::FastHasher].
10pub type FastConcurrentHashSet<T> = papaya::HashSet<T, FastBuildHasher>;
11
12/// A concurrent hash map based on `papaya` ([`HashMap`][papaya::HashMap]) using [`FastHasher`][crate::hash::FastHasher].
13pub type FastConcurrentHashMap<K, V> = papaya::HashMap<K, V, FastBuildHasher>;
14
15/// A hash map with stable insertion order based on `indexmap` ([`IndexMap`][indexmap::IndexMap]) using [`FastHasher`][crate::hash::FastHasher].
16pub type FastIndexMap<K, V> = indexmap::IndexMap<K, V, FastBuildHasher>;
17
18/// A hash set based on the standard library's ([`HashSet`][std::collections::HashSet]) using [`NoopU64Hasher`][crate::hash::NoopU64Hasher].
19///
20/// This is only suitable for `u64` values, or values which only wrap over a `u64` value. See
21/// [`NoopU64Hasher`][crate::hash::NoopU64Hasher] for more details.
22pub type PrehashedHashSet<T> = std::collections::HashSet<T, NoopU64BuildHasher>;
23
24/// A hash map based on the standard library's ([`HashMap`][std::collections::HashMap]) using [`NoopU64Hasher`][crate::hash::NoopU64Hasher].
25///
26/// This is only suitable when using `u64` for the key type, or another type which only wraps over a `u64` value. See
27/// [`NoopU64Hasher`][crate::hash::NoopU64Hasher] for more details.
28pub type PrehashedHashMap<K, V> = std::collections::HashMap<K, V, NoopU64BuildHasher>;