Expand description
A small inline SIMD-accelerated hashmap designed for small amounts of data.
SmallMap stores data inline when the number of elements is small (up to N),
and automatically spills to the heap when it grows beyond that threshold.
§Examples
use small_map::SmallMap;
let mut map: SmallMap<8, &str, i32> = SmallMap::new();
map.insert("a", 1);
map.insert("b", 2);
assert_eq!(map.get(&"a"), Some(&1));
assert!(map.contains_key(&"b"));
assert!(map.is_inline()); // Still stored inlineStructs§
- Into
Keys - A consuming iterator over the keys of a
SmallMap. - Into
Values - A consuming iterator over the values of a
SmallMap. - Keys
- An iterator over the keys of a
SmallMap. - Values
- An iterator over the values of a
SmallMap.
Enums§
- Into
Iter - Iter
- Small
Map - A hybrid map that stores data inline when small, and spills to heap when it grows.
Constants§
- DEFAULT_
LINEAR_ THRESHOLD - Default threshold for switching from linear search to SIMD hash search.
When
Norlenis less than this value, linear search is used. Equal to the SIMD group width (16 on SSE2, 8 on NEON/generic).
Traits§
- Equivalent
- Re-exported from
hashbrownfor custom key equivalence lookups.
Type Aliases§
- FxSmall
Map - Type alias for
SmallMapusingrustc_hash::FxBuildHasheras the heap hasher. - Rapid
Small Map - Type alias for
SmallMapusingrapidhashas the heap hasher.