compactmap

CompactMap data structure for Rust

Downloads
11.8K
Stars
6
Committers
1

Compactmap - Vec-based map that uses usize as key type and maintains internal linked list for removed nodes.

You don't choose the key when inserting a new value. You can remove any entry.

Based on this post by eddyb.

The function and structure of CompactMap is almost the same as Slab apart from missing cached length and more features. If I knew about Slab earlier, CompactMap wouldn't have appeared.

TODO:

  • More thorough tests
  • Entry (is it really needed?)

License is MIT or Apache, like for Rust itself.