Data Structures
Rust implementations of ways of organizing data suited for specific purposes.
Bitflags
Recipe | Crates | Categories |
---|---|---|
Define and operate on a type represented as a bitfield | ||
flagset |
Hashmaps and friends
Recipe | Crates | Categories |
---|---|---|
Store data in an insertion-ordered map | ||
Store data in a multimap | ||
slotmap |
Stack-allocated arrays
UUIDs
Recipe | Crates | Categories |
---|---|---|
Generate and parse UUIDs |
[data-structures: expand (P1)](https://github.com/john-cd/rust_howto/issues/280)
Hashset BinaryHeap LinkedList Stack Queue BTreeMap BTreeSet
Alongside arrayvec and tinyvec, heapless
has stack-allocated arrays, but also includes:
Arc – like std::sync::Arc but backed by a lock-free memory pool rather than #[global_allocator]
Box – like std::boxed::Box but backed by a lock-free memory pool rather than #[global_allocator]
BinaryHeap – priority queue
IndexMap – hash table
IndexSet – hash set
LinearMap
Object – objects managed by an object pool
String
Vec
mpmc::Q* – multiple producer multiple consumer lock-free queue
spsc::Queue – single producer single consumer lock-free queue