3 releases
0.1.2 | May 16, 2020 |
---|---|
0.1.1 | Feb 19, 2018 |
0.1.0 | Aug 16, 2017 |
#83 in #newtype
356 downloads per month
Used in idmap
7KB
95 lines
rust-idmap
Efficient maps of integer id keys to values, backed by an underlying Vec
.
Features
- Automiatically derived
IntegerId
for enums and newtype structs- Implemented in the
idmap-derive
proc_macro crate
- Implemented in the
- Maintains insertion order of the entries, as there's an indirection like
OrderMap
.- Therefore, entries which aren't present take little space, as only a
u32
needs to be stored. - This indirection can be avoided with a
DirectIdMap
which doesn't preserve order, and saves space when the ids of the map's keys are densly packed and mostly present.
- Therefore, entries which aren't present take little space, as only a
Dependencies
~1.5MB
~37K SLoC