Linked Hash Table
A Rust LinkedHashMap / LinkedHashSet implementation that preserves insertion order while keeping fast hash-based lookups.
Features
- Insertion-order iteration
- O(1)-style lookup by key
- Push/pop at both ends (
front/back) LinkedHashSetbuilt on top ofLinkedHashMap- No reordering happening on already existing keys
Data structure
The map combines:
- A hash table index (
hashbrown 0.16) for key lookup - A doubly-linked list for deterministic order
- Sentinel
head/tailnodes to simplify edge cases
This enables stable order operations while preserving efficient key access.
Usage
use ;
Development
Run tests:
Run Miri (strict provenance):
RUSTUP_TOOLCHAIN="nightly" MIRIFLAGS="-Zmiri-strict-provenance"
Run coverage:
License
This project is licensed under the MIT License. See the LICENSE file for details.