7 releases (breaking)
| 0.7.0 | Oct 28, 2023 |
|---|---|
| 0.6.0 | Sep 17, 2023 |
| 0.5.0 | Sep 17, 2023 |
| 0.4.0 | Sep 17, 2023 |
| 0.1.0 | Aug 6, 2023 |
#1779 in Data structures
130KB
2K
SLoC
Enter the Data Zoo
A collection of data structures interesting enough to put in free range pens.
Features
This is a collection of multimaps, jagged arrays, bit sets, and combination thereof.
Highlights:
- A storage-agnostic
Bitset. - A storage-agnostic
JaggedArray. - A
PackedIntArraysimilar tobitpacking,bitvecand other bitpacking rust crates. - A bi-directional read-only multimap:
BimultiMap enumset-keyed data structures.
See rustdoc documentation for details.
Cargo Features
enumset: enables theenumsetdependency and theEnumBitMatrixEnumMultimapdata structuressmallvec: (off by default) Implementbitset::ExtendBlocksonSmallVec.
Unique features
JaggedArrayis generic over storage types, which means you can take advantage of your own specializedsliceimpl such asSmallVec, or a fixed sze array stored on the stack (typically useful if you have a fixed height matrix).Bitsetis also generic over storage type, with the same implications.
Limitations
- Data structures do not handle
Droptypes at all. - Data structures are untested with sizes
> u32::MAX - Effort is made to panic in those situations though, but you never know
- Generally assumes
size_of(usize) >= size_of(u32) - Definitively not as tested and benchmarked as other similar crates.
- No
#[no_std]but I don't see why this couldn't be added as a feature - depends on
sorted-iter, can't disable dependency. Bitsetgenerally doesn't distinguish between "disabled within bound" and "out of bound".
History
This was first built for the cuicui_richtext project, but became useful for
other things, so it got published separately.
License
You may use datazoo under any of the following licenses:
- ZLib
- MIT
- Apache 2.0
Dependencies
~3.5MB
~74K SLoC