6 releases (breaking)

0.6.0 Sep 17, 2023
0.5.0 Sep 17, 2023
0.4.0 Sep 17, 2023
0.3.0 Sep 17, 2023
0.1.0 Aug 6, 2023

#386 in Data structures

Download history 16/week @ 2023-08-04 2/week @ 2023-08-11 2/week @ 2023-08-18 2/week @ 2023-08-25 1/week @ 2023-09-01 1/week @ 2023-09-08 113/week @ 2023-09-15 19/week @ 2023-09-22

134 downloads per month

MIT OR Apache-2.0 OR Zlib


Enter the Data Zoo

A collection of data structures interesting enough to put in free range pens.


This is a collection of multimaps, jagged arrays, bit sets, and combination thereof.


  • A storage-agnostic Bitset.
  • A storage-agnostic JaggedArray.
  • A PackedIntArray similar to bitpacking, bitvec and other bitpacking rust crates.
  • A bi-directional read-only multimap: BimultiMap
  • enumset-keyed data structures.

See rustdoc documentation for details.

Cargo Features

  • enumset: enables the enumset dependency and the EnumBitMatrix EnumMultimap data structures
  • smallvec: (off by default) Implement bitset::ExtendBlocks on SmallVec.

Unique features

  • JaggedArray is generic over storage types, which means you can take advantage of your own specialized slice impl such as SmallVec, or a fixed sze array stored on the stack (typically useful if you have a fixed height matrix).
  • Bitset is also generic over storage type, with the same implications.


  • Data structures do not handle Drop types 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.
  • Bitset generally doesn't distinguish between "disabled within bound" and "out of bound".


This was first built for the cuicui_richtext project, but became useful for other things, so it got published separately.


You may use datazoo under any of the following licenses:

  • ZLib
  • MIT
  • Apache 2.0


~65K SLoC