Crates.io | ringmap |
lib.rs | ringmap |
version | 0.1.8 |
created_at | 2025-01-21 23:11:58.950741+00 |
updated_at | 2025-09-18 19:27:25.574856+00 |
description | A hash table with consistent deque-like order and fast iteration. |
homepage | |
repository | https://github.com/indexmap-rs/ringmap |
max_upload_size | |
id | 1525909 |
size | 548,432 |
A pure-Rust hash table which preserves (in a limited sense) insertion order, with efficient deque-like manipulation of both the front and back ends.
This crate implements compact map and set data-structures, where the iteration order of the keys is independent from their hash or value. It preserves insertion order in most mutating operations, and it allows lookup of entries by either hash table key or numerical index.
This crate was forked from indexmap
,
with the primary difference being a change from Vec
to VecDeque
for the
primary item storage. As a result, it has many of the same properties, as
well as a few new ones:
.swap_remove_back()
or other methods that explicitly change order.
ringmap
, the regular .remove()
does preserve insertion order,
equivalent to what indexmap
calls .shift_remove()
.HashMap
does.ringmap
also follows ordermap
in using
its entry order for PartialEq
and Eq
, whereas indexmap
considers the same
entries in any order to be equal for drop-in compatibility with HashMap
semantics. Using the order is faster, and also allows ringmap
to implement
PartialOrd
, Ord
, and Hash
.
See RELEASES.md.