Crate small_map

Crate small_map 

Source
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 inline

Structs§

IntoKeys
A consuming iterator over the keys of a SmallMap.
IntoValues
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§

IntoIter
Iter
SmallMap
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 N or len is 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 hashbrown for custom key equivalence lookups.

Type Aliases§

FxSmallMap
Type alias for SmallMap using rustc_hash::FxBuildHasher as the heap hasher.
RapidSmallMap
Type alias for SmallMap using rapidhash as the heap hasher.