hash_trie/
lib.rs

1#![cfg_attr(not(test), no_std)]
2
3#[allow(unused_imports)]
4#[macro_use]
5extern crate alloc;
6
7#[macro_use]
8mod result;
9mod bit_indexed_array;
10mod flag;
11mod hash_trie;
12mod map;
13mod node;
14mod set;
15pub mod traits;
16
17pub use result::BitError as BitError;
18pub use result::HashTrieError as HashTrieError;
19
20pub use result::SetTransformResult as SetTransformResult;
21pub use result::SetJointTransformResult as SetJointTransformResult;
22pub use result::SetTransmuteResult as SetTransmuteResult;
23
24pub use result::MapTransformResult as MapTransformResult;
25pub use result::MapJointTransformResult as MapJointTransformResult;
26pub use result::MapTransmuteResult as MapTransmuteResult;
27
28pub use set::HashTrieSet as HashTrieSet;
29pub use map::HashTrieMap as HashTrieMap;
30
31/// A HashTrieSet using 64-bit hashes, 32-bit flags, and FnvHasher
32pub type DefaultHashTrieSet<V> = set::HashTrieSet<u64, u32, V, fnv::FnvHasher>;
33
34/// A HashTrieMap using 64-bit hashes, 32-bit flags, and FnvHasher
35pub type DefaultHashTrieMap<K, V> = map::HashTrieMap<u64, u32, K, V, fnv::FnvHasher>;
36
37#[cfg(test)]
38mod tests {
39    use crate::{DefaultHashTrieMap, DefaultHashTrieSet};
40    use alloc::string::String;
41
42    #[test]
43    fn default_test() {
44        let _hash_set = DefaultHashTrieSet::<i32>::new().insert(42, false);
45        let _hash_map = DefaultHashTrieMap::<i32, String>::new().insert(42, "Hello, world!", false);
46    }
47
48}