Skip to main content

saluki_common/collections/
mod.rs

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