kevy_map/lib.rs
1//! `kevy-map` — a purpose-built open-addressing hashtable for kevy's keyspace.
2//!
3//! Per-shard, single-threaded, single-trust-domain. Trades `std::HashMap`'s
4//! generality for three kevy-specific wins:
5//!
6//! 1. **Bucket-address API** (`prefetch_for_hash`, future) — exposes the
7//! table's bucket metadata pointer so the command-batch driver can
8//! `prefetcht0` the next command's group while finishing the current.
9//! 2. **No DoS-hardening tax** — single trust domain ⇒ no random seed.
10//! Hasher is `kevy_hash::KevyHash` (one-call inlinable).
11//! 3. **Cache-conscious layout** — Swiss-style metadata bytes scanned (scalar
12//! in this commit; SSE2 group scan lands in a later pass); slots
13//! AoS so the post-match key+value read hits one cache line.
14//!
15//! See the crate README for the design rationale.
16//!
17//! Constraints: pure Rust, no `crates.io` deps; `unsafe` is allowed here (scoped
18//! to this crate) so `kevy-store` keeps `forbid(unsafe_code)`.
19
20#![deny(unsafe_op_in_unsafe_fn)]
21#![warn(missing_docs)]
22
23mod group;
24mod iter;
25mod map;
26mod map_keyed;
27mod set;
28
29pub use kevy_hash::KevyHash;
30pub use iter::{Iter, IterMut, Keys, Values};
31pub use map::KevyMap;
32pub use set::{KevySet, SetIter};