iddqd
Maps where keys borrow from values, including bijective and trijective maps.
0.4.6
5.1M downloads/mo
#4483 most downloaded on crates.io
oxidecomputer/iddqd
What this package is like to depend on
Last release 1 months ago
21 Jul 2026
Release timing varies
gaps range from 8 days to 5 months
Nearly every release is documented
notes for 31 of 31 stable releases
Nothing withdrawn
no release was ever pulled
1 years old
31 releases · first in 2025
14 releases in the last 12 months
see the full history below
Release timeline
31 releases · May 2025 to Jul 2026Releases
latest 31-
0.4.621 Jul 2026Release notes
Open source →Added
-
from_iter_uniqueconstructors onIdHashMap,BiHashMap, andTriHashMap, matching the existingIdOrdMap::from_iter_unique. These build a map from an iterator and, rather than overwriting, return an error on the first item that conflicts with an already-inserted one.Because a value in a
BiHashMaporTriHashMapcan conflict on more than one key at once, the error reports every distinct existing item it collides with (up to two forBiHashMapand up to three forTriHashMap).
Changed
- MSRV updated to Rust 1.86.
Fixed
-
Deserialization no longer preallocates based on an unbounded size hint. Length-prefixed formats such as bincode and postcard derive their size hint from the input, so a small hostile payload claiming a huge number of elements could previously cause an excessively large allocation before any element was read. Preallocation is now capped at 1 MiB worth of items, matching what
serdedoes for the standard library's collections. -
The
insert_overwritepath onIdHashMapno longer aborts when an allocation fails, matching the existing guarantee onBiHashMapandTriHashMap. Instead, it results in a catchable panic. (The map is left unchanged, similar toBiHashMapandTriHashMap.)Note that
BTreeMap::insert_overwritewill abort on allocation failure, because it calls intostdwhich doesn't have an equivalent toHashMap::try_reserve.
Other improvements
- The insert paths now do fewer redundant checks for duplicates. Thanks izuzak for your first contribution!
Release notes
Open source →Added
-
from_iter_uniqueconstructors onIdHashMap,BiHashMap, andTriHashMap, matching the existingIdOrdMap::from_iter_unique. These build a map from an iterator and, rather than overwriting, return an error on the first item that conflicts with an already-inserted one.Because a value in a
BiHashMaporTriHashMapcan conflict on more than one key at once, the error reports every distinct existing item it collides with (up to two forBiHashMapand up to three forTriHashMap).
Changed
- MSRV updated to Rust 1.86.
Fixed
-
Deserialization no longer preallocates based on an unbounded size hint. Length-prefixed formats such as bincode and postcard derive their size hint from the input, so a small hostile payload claiming a huge number of elements could previously cause an excessively large allocation before any element was read. Preallocation is now capped at 1 MiB worth of items, matching what
serdedoes for the standard library's collections. -
The
insert_overwritepath onIdHashMapno longer aborts when an allocation fails, matching the existing guarantee onBiHashMapandTriHashMap. Instead, it results in a catchable panic. (The map is left unchanged, similar toBiHashMapandTriHashMap.)Note that
BTreeMap::insert_overwritewill abort on allocation failure, because it calls intostdwhich doesn't have an equivalent toHashMap::try_reserve.
Other improvements
- The insert paths now do fewer redundant checks for duplicates. Thanks izuzak for your first contribution!
-
-
0.4.517 Jun 2026Release notes
Open source →Added
-
iddqd's core invariants are now formally verified under adversarialHashandOrdimpls using the Soteria symbolic executor. No new bugs were found during this process.The formal verification is broad (covers all possible adversarial return values) but bounded-depth; it acts as a complement to the existing layers of randomized testing, which are less broad but generate much deeper operation sequences.
For more information on our validation philosophy, see this Oxide blog entry.
-
Expanded examples for
BiHashMap'sEntry.
Release notes
Open source →Added
-
iddqd's core invariants are now formally verified under adversarialHashandOrdimpls using the Soteria symbolic executor. No new bugs were found during this process.The formal verification is broad (covers all possible adversarial return values) but bounded-depth; it acts as a complement to the existing layers of randomized testing, which are less broad but generate much deeper operation sequences.
For more information on our validation philosophy, see this Oxide blog entry.
-
Expanded examples for
BiHashMap'sEntry.
-
-
0.4.409 Jun 2026Release notes
Open source →Changed
- The
FromIteratorimplementations now reserve capacity at the start of the operation.
Release notes
Open source →Changed
- The
FromIteratorimplementations now reserve capacity at the start of the operation.
- The
-
0.4.308 Jun 2026Release notes
Open source →Fixed
- The
insert_overwritepaths onBiHashMapandTriHashMapare now atomic in case user code panics. Thanks to SG-devel for your first contribution!
Release notes
Open source →Fixed
- The
insert_overwritepaths onBiHashMapandTriHashMapare now atomic in case user code panics. Thanks to SG-devel for your first contribution!
- The
-
0.4.223 May 2026Release notes
Open source →Fixed
- The
retaincallbacks no longer permit theRefMutto be stashed outside them. This is technically a breaking change, but is being treated as a soundness bugfix. - A number of soundness and resilience fixes for pathological implementations. These were found through a combination of human-driven analysis, example-based tests with Miri, chaos testing using fault injection with proptest, and adversarial code review from Claude Opus 4.7 and GPT-5.5. In particular, iddqd now more consistently preserves internal map state across panics in user code by using patterns like prepare-then-commit, index-based cleanup, cached hashes, and careful ordering of user-code execution relative to internal mutations.
Changed
- MSRV updated to Rust 1.85.
Release notes
Open source →Fixed
- The
retaincallbacks no longer permit theRefMutto be stashed outside them. This is technically a breaking change, but is being treated as a soundness bugfix. - A number of soundness and resilience fixes for pathological implementations. These were found through a combination of human-driven analysis, example-based tests with Miri, chaos testing using fault injection with proptest, and adversarial code review from Claude Opus 4.7 and GPT-5.5. In particular, iddqd now more consistently preserves internal map state across panics in user code by using patterns like prepare-then-commit, index-based cleanup, cached hashes, and careful ordering of user-code execution relative to internal mutations.
Changed
- MSRV updated to Rust 1.85.
- The
-
0.4.116 May 2026Release notes
Open source →Fixed
- Fixed a logic bug in
TriHashMap::remove_unique, whenkey1matches, and one ofkey2andkey3matches, but not the other.
Release notes
Open source →Fixed
- Fixed a logic bug in
TriHashMap::remove_unique, whenkey1matches, and one ofkey2andkey3matches, but not the other.
- Fixed a logic bug in
-
0.4.004 May 2026Release notes
Open source →Changed
- The internal implementation for item storage has been changed to use a linear slot-based buffer, resulting in 2-3x performance improvements for most workloads.
- The maps now have a limit of
u32::MAX(4 294 967 295) elements at any given time. This limit is very unlikely to be reached in practice.
Fixed
- All mutation methods for
IdHashMapandIdOrdMapare now panic-safe, in the sense that a panic in user code will not corrupt the map. This does not currently extend toBiHashMapandTriHashMap
Added
- Many more unit and property-based tests covering various kinds of pathological user implementations. We now have high confidence that arbitraily buggy user implementations (as long as they're in safe Rust) will not result in undefined behavior.
Release notes
Open source →Changed
- The internal implementation for item storage has been changed to use a linear slot-based buffer, resulting in 2-3x performance improvements for most workloads.
- The maps now have a limit of
u32::MAX(4 294 967 295) elements at any given time. This limit is very unlikely to be reached in practice.
Fixed
- All mutation methods for
IdHashMapandIdOrdMapare now panic-safe, in the sense that a panic in user code will not corrupt the map. This does not currently extend toBiHashMapandTriHashMap
Added
- Many more unit and property-based tests covering various kinds of pathological user implementations. We now have high confidence that arbitraily buggy user implementations (as long as they're in safe Rust) will not result in undefined behavior.
-
0.3.1823 Apr 2026Release notes
Open source →Fixed
- Fixed a rehashing bug in hash map reserve and shrink-to-fit methods. (Due to an oversight, these methods were previously not part of our property-based tests. Now they are. Sorry about that!)
Release notes
Open source →Fixed
- Fixed a rehashing bug in hash map reserve and shrink-to-fit methods. (Due to an oversight, these methods were previously not part of our property-based tests. Now they are. Sorry about that!)
-
0.3.1722 Nov 2025Release notes
Open source →Added
- Capacity management methods for all map types:
reserve(&mut self, additional: usize)reserves capacity for at leastadditionalmore elements.shrink_to_fit(&mut self)shrinks capacity to fit the current length.shrink_to(&mut self, min_capacity: usize)shrinks capacity to at leastmin_capacity.try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError>: fallible capacity reservation for hash maps (IdHashMap,BiHashMap,TriHashMap).
- New
TryReserveErrortype in theerrorsmodule for reporting allocation failures.
Notes
- For
IdOrdMap, the reserve and shrink methods only affect item storage. The internalBTreeSetused for item ordering does not support capacity control. IdOrdMapdoes not providetry_reserve, since the underlyingBTreeSetdoes not expose fallible reservation operations.
Fixed
- Fixed an instance of potential unsoundness in
retain.
Changed
The
Extendimplementations now pre-reserve capacity based on the iterator'ssize_hint.Release notes
Open source →Added
- Capacity management methods for all map types:
reserve(&mut self, additional: usize)reserves capacity for at leastadditionalmore elements.shrink_to_fit(&mut self)shrinks capacity to fit the current length.shrink_to(&mut self, min_capacity: usize)shrinks capacity to at leastmin_capacity.try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError>: fallible capacity reservation for hash maps (IdHashMap,BiHashMap,TriHashMap).
- New
TryReserveErrortype in theerrorsmodule for reporting allocation failures.
Notes
- For
IdOrdMap, the reserve and shrink methods only affect item storage. The internalBTreeSetused for item ordering does not support capacity control. IdOrdMapdoes not providetry_reserve, since the underlyingBTreeSetdoes not expose fallible reservation operations.
Fixed
- Fixed an instance of potential unsoundness in
retain.
Changed
The
Extendimplementations now pre-reserve capacity based on the iterator'ssize_hint. - Capacity management methods for all map types:
-
0.3.1609 Nov 2025Release notes
Open source →Added
clearmethods for all map types to remove all items from the map.- Optionally, serialize ID maps as maps (JSON objects) rather than sequences (JSON arrays):
- New
IdHashMapAsMap,BiHashMapAsMap,TriHashMapAsMap, andIdOrdMapAsMapmarker types to use with#[serde(with = ...)]. - The default deserializer for each map now accepts both maps and sequences.
- New
Changed
- Documentation improvements for serde implementations.
-
0.3.1509 Nov 2025Release notes
Open source →Added
retainmethods that allow filtering items in place based on a predicate.IdOrdMap::first,first_entry,last,last_entry,pop_first, andpop_lastmethods for accessing entries at the beginning and end of the map.BiHashMap::with_hasherandTriHashMap::with_hasherare nowconst fn.
Changed
- Reduced memory footprint for
BiHashMapandTriHashMap.
-
0.3.1429 Sep 2025Release notes
Open source →Fixed
Replaced obsolete
doc_auto_cfgwithdoc_cfg, to fix Rust nightly builds with thedoc_cfgflag enabled. -
0.3.1315 Sep 2025Release notes
Open source →Changed
- iddqd now depends on
serde_corerather thanserde. This allows iddqd's compilation to be parallelized withserde_derive. - Internal dependency updates:
foldhashupdated to 0.2, andhashbrownupdated to 0.16.
- iddqd now depends on
-
0.3.1212 Sep 2025Release notes
Open source →Added
The following methods are now
const fn:IdOrdMap::newIdHashMap::with_hasher
-
0.3.1114 Aug 2025Release notes
Open source →Fixed
The type definitions for
IdHashMap,BiHashMap,TriHashMap, andIdOrdMapno longer requireIdHashItem,BiHashItem,TriHashItem, andIdOrdItem, respectively. This matches the standard library'sHashMapandBTreeMaptype definitions which don't requireHash + EqorOrdbounds.Thanks to aatifsyed for your first contribution!
-
0.3.1012 Aug 2025Release notes
Open source →Fixed
id_ord_map::RefMut'sreborrowmethod now works if the underlyingIdOrdItemis non-'static. -
0.3.922 Jul 2025Release notes
Open source →Added
- For the optional
daftfeature, the mapDifftypes now implementfmt::Debug.
Miscellaneous
- Several documentation fixes.
- For the optional
-
0.3.823 Jun 2025Release notes
Open source →Added
- New
proptestfeature adds strategy andArbitraryimplementations for map types.
- New
-
0.3.711 Jun 2025Release notes
Open source →Fixed
- iddqd is now compatible with schemars's
preserve_orderfeature. Thanks Sh3Rm4n for your first contribution!
- iddqd is now compatible with schemars's
-
0.3.606 Jun 2025Release notes
Open source →Changed
- Relaxed
Debugrequirement to only require thatT::Key<'a>: fmt::Debug, notfor<'k> T::Key<'k>: fmt::Debug. This allows items with borrowed data to compile in more cases. - Relaxed
Hashrequirement forIdOrdMapget_mutand related APIs in a similar fashion.
- Relaxed
-
0.3.505 Jun 2025 -
0.3.403 Jun 2025Release notes
Open source →Added
- New macros
id_hash_map,bi_hash_map,tri_hash_map, andid_ord_mapallow easy construction of literal macros. These macros useinsert_unique, so they panic if duplicate keys are encountered.
Changed
- The
id_upcast,bi_upcastandtri_upcastmacros now have aSelf: 'longbound, allowing them to be used for non-'staticitems. - Minimized dependency list, removing the dependency on
derive-where,debug-ignore, and serde'sderivefeature. iddqd no longer depends on any proc macros.
- New macros
-
0.3.327 May 2025Release notes
Open source →Added
- A lot of new documentation. Most functions now have doctests.
Fixed
- Serde implementations no longer do internal buffering.
- Serde implementations now reserve capacity if the size hint is available; thanks @aatifsyed for your first contribution!
- A few unnecessary bounds have been loosened.
-
0.3.225 May 2025Release notes
Open source →Added
- The hash map types now support custom hashers.
- With the new
allocator-api2feature (enabled by default), the hash map types now support custom allocators, including on stable. See the bumpalo-alloc example. - Added some documentation explaining iteration order.
- Added a note in the README and
lib.rsthat small copyable keys like integers are best returned as owned ones.
Changed
- Dropped the
Ordrequirement forComparablekeys. (TheHashrequirement forEquivalentcontinues to be required.)
-
0.3.122 May 2025 -
0.3.022 May 2025Release notes
Open source →Changed
- Lookups now use
equivalent::Equivalentorequivalent::Comparable, which are strictly more general thanBorrow. get_mutandremovemethods no longer require the key type; the borrow checker limitation has been worked around.
- Lookups now use
-
0.2.122 May 2025Release notes
Open source →Fixed
MapLeaf<'a, T>'sCloneandCopyno longer requireTto beCloneorCopy. (MapLeafis just a couple of references, so this is never necessary.)
-
0.2.022 May 2025Release notes
Open source →Added
Extendimplementations.
Changed
- Daft implementations for
BiHashMapandTriHashMapchanged to also allow diffing by individual keys.
-
0.1.222 May 2025Release notes
Open source →Added
BiHashMapandTriHashMapnow have aremove_uniquemethod which removes an item uniquely indexed by all keys.
Changed
upcastmacros are now annotated with#[inline], since they're trivial.
-
0.1.121 May 2025Release notes
Open source →Added
- Daft implementations with the new
daftfeature. BiHashItemimplementations for reference types like&'a TandBox<T>.
- Daft implementations with the new
-
0.1.021 May 2025Release notes
Open source →Initial release.
<!-- next-url --> [0.4.6]: https://github.com/oxidecomputer/iddqd/releases/tag/iddqd-0.4.6 [0.4.5]: https://github.com/oxidecomputer/iddqd/releases/tag/iddqd-0.4.5 [0.4.4]: https://github.com/oxidecomputer/iddqd/releases/tag/iddqd-0.4.4 [0.4.3]: https://github.com/oxidecomputer/iddqd/releases/tag/iddqd-0.4.3 [0.4.2]: https://github.com/oxidecomputer/iddqd/releases/tag/iddqd-0.4.2 [0.4.1]: https://github.com/oxidecomputer/iddqd/releases/tag/iddqd-0.4.1 [0.4.0]: https://github.com/oxidecomputer/iddqd/releases/tag/iddqd-0.4.0 [0.3.18]: https://github.com/oxidecomputer/iddqd/releases/tag/iddqd-0.3.18 [0.3.17]: https://github.com/oxidecomputer/iddqd/releases/tag/iddqd-0.3.17 [0.3.16]: https://github.com/oxidecomputer/iddqd/releases/tag/iddqd-0.3.16 [0.3.15]: https://github.com/oxidecomputer/iddqd/releases/tag/iddqd-0.3.15 [0.3.14]: https://github.com/oxidecomputer/iddqd/releases/tag/iddqd-0.3.14 [0.3.13]: https://github.com/oxidecomputer/iddqd/releases/tag/iddqd-0.3.13 [0.3.12]: https://github.com/oxidecomputer/iddqd/releases/tag/iddqd-0.3.12 [0.3.11]: https://github.com/oxidecomputer/iddqd/releases/tag/iddqd-0.3.11 [0.3.10]: https://github.com/oxidecomputer/iddqd/releases/tag/iddqd-0.3.10 [0.3.9]: https://github.com/oxidecomputer/iddqd/releases/tag/iddqd-0.3.9 [0.3.8]: https://github.com/oxidecomputer/iddqd/releases/tag/iddqd-0.3.8 [0.3.7]: https://github.com/oxidecomputer/iddqd/releases/tag/iddqd-0.3.7 [0.3.6]: https://github.com/oxidecomputer/iddqd/releases/tag/iddqd-0.3.6 [0.3.5]: https://github.com/oxidecomputer/iddqd/releases/tag/iddqd-0.3.5 [0.3.4]: https://github.com/oxidecomputer/iddqd/releases/tag/iddqd-0.3.4 [0.3.3]: https://github.com/oxidecomputer/iddqd/releases/tag/iddqd-0.3.3 [0.3.2]: https://github.com/oxidecomputer/iddqd/releases/tag/iddqd-0.3.2 [0.3.1]: https://github.com/oxidecomputer/iddqd/releases/tag/iddqd-0.3.1 [0.3.0]: https://github.com/oxidecomputer/iddqd/releases/tag/iddqd-0.3.0 [0.2.1]: https://github.com/oxidecomputer/iddqd/releases/tag/iddqd-0.2.1 [0.2.0]: https://github.com/oxidecomputer/iddqd/releases/tag/iddqd-0.2.0 [0.1.2]: https://github.com/oxidecomputer/iddqd/releases/tag/iddqd-0.1.2 [0.1.1]: https://github.com/oxidecomputer/iddqd/releases/tag/iddqd-0.1.1 [0.1.0]: https://github.com/oxidecomputer/iddqd/releases/tag/iddqd-0.1.0