pagecache/
map.rs

1use {
2    fxhash::{FxHasher, FxHasher32, FxHasher64},
3    std::{
4        collections::{HashMap, HashSet},
5        hash::BuildHasherDefault,
6    },
7};
8
9/// A fast map that is not resistant to collision attacks. Works
10/// on one byte at a time.
11pub type FastMap1<K, V> = HashMap<K, V, BuildHasherDefault<FxHasher>>;
12
13/// A fast map that is not resistant to collision attacks. Works
14/// on 4 bytes at a time.
15pub type FastMap4<K, V> = HashMap<K, V, BuildHasherDefault<FxHasher32>>;
16
17/// A fast map that is not resistant to collision attacks. Works
18/// on 8 bytes at a time.
19pub type FastMap8<K, V> = HashMap<K, V, BuildHasherDefault<FxHasher64>>;
20
21/// A fast set that is not resistant to collision attacks. Works
22/// on one byte at a time.
23pub type FastSet1<V> = HashSet<V, BuildHasherDefault<FxHasher>>;
24
25/// A fast set that is not resistant to collision attacks. Works
26/// on 4 bytes at a time.
27pub type FastSet4<V> = HashSet<V, BuildHasherDefault<FxHasher32>>;
28
29/// A fast set that is not resistant to collision attacks. Works
30/// on 8 bytes at a time.
31pub type FastSet8<V> = HashSet<V, BuildHasherDefault<FxHasher64>>;