1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
//! # `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
//! - **`SoA` Layout**: Metadata, keys, and values are stored in parallel 64B-aligned arrays.
//! - **Robin Hood Probing**: Displaces entries with lower `DfH` to bound probe chains.
//! - **Zero-Dependency Core**: Relies only on `xxhash-rust` for 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. `unsafe` is documented with `# Safety` invariants.
//! - Strict `rustdoc` enforcement (`-D warnings`) and ≥90% internal logic coverage.
//! - MSRV: `1.95.0` | Edition: `2024`
extern crate alloc;
pub use RobinHoodKey;
pub use RobinHoodMap;