2 ms·
There's petgraph (https://crates.io/crates/petgraph https://crates.io/crates/petgraph), which uses integers as node and edge indexes, instead of pointers. That
by cesarb 10y ago
There's petgraph (https://crates.io/crates/petgraph https://crates.io/crates/petgraph), which uses integers as node and edge indexes, instead of pointers. That is a common trick to work around the borrow checker: instead of pointers into a data structure, store an index into that data structure.
- jmcomets 10y agoMoreover, there's stash.rs[1] that provides a fast map that generates keys, which is perfect when you need a fast indexing of generic data. [1]: https://github.com/Stebalien/stash-rs https://github.com/Stebalien/stash-rs