Expand description
§robinxx_map
High-performance, thread-safe open-addressing hash map utilizing Robin Hood
displacement with Distance from Home (DfH) tracking and xxHash3 for key hashing.
Designed for #![no_std] environments with explicit alloc support, and guarantees
Send + Sync across all targets via an internal atomic spinlock. All public APIs are
strictly safe, with internal unsafe blocks confined to allocation, probing, and
memory layout manipulation.
§Architecture
SoALayout: Metadata, keys, and values are stored in parallel 64B-aligned arrays.- Robin Hood Probing: Displaces entries with lower
DfHto bound probe chains. - Zero-Dependency Core: Relies only on
xxhash-rustfor stable hashing.
§Example
use robinxx_map::RobinHoodMap;
// Defaults to Global allocator when `std` is available.
let mut map = RobinHoodMap::<&str, i32>::new();
map.insert("key".into(), 42);
assert_eq!(map.with_key(&"key".into(), |v| *v), Some(42));§Safety & Compliance
- Public API is 100% safe.
unsafeis documented with# Safetyinvariants. - Strict
rustdocenforcement (-D warnings) and ≥90% internal logic coverage. - MSRV:
1.95.0| Edition:2024
Re-exports§
pub use hash::RobinHoodKey;pub use map::RobinHoodMap;
Modules§
- entry
- Entry API for in-place modification and conditional insertion.
- hash
- Hashing primitives and
xxhash-rustwrapper forRobinHoodKeytrait. - iter
- Safe traversal iterators:
Iter,IterMut,Keys,Values,Drain. - map
- Safe public API surface for
RobinHoodMap<K, V>. - memory
- Memory layout calculation, alignment enforcement, and allocation.
- sync
- Concurrency primitives for
no_stdthread-safety. - table
- Low-level
RawTableimplementation: probing, insert, erase, resize, andDfHlogic.