More collections   ![Latest Version] ![Docs badge] License: Apache-2.0

Additional Rust collections not found in std::collections.

Small* collections

Built on top of the excellent smallvec crate, SmallMap and SmallSet are a Map and Set respectively that are inlined if they contain fewer values than a (statically chosen) capacity C, otherwise they are heap allocated and backed by an IndexMap.

Multimaps

| Completion | Name | Behaves as | | ---------- | -------------------- | -------------------------- | | 🟩🟩🟩🟩🟨 | HashSetMultimap | HashMap<K, HashSet<V>> | | 🟩🟩🟩🟩🟨 | HashVecMultimap | HashMap<K, Vec<V>> | | 🟩🟩🟩🟩🟨 | IndexSetMultimap | IndexMap<K, IndexSet<V>> | | 🟩🟩🟩🟩🟨 | IndexVecMultimap | IndexMap<K, Vec<V>> | | ⬜️⬜️⬜️⬜️⬜️ | BTreeSetMultimap | BTreeMap<K, BTreeSet<V>> | | ⬜️⬜️⬜️⬜️⬜️ | BTreeVecMultimap | BTreeMap<K, Vec<V>> | | ⬜️⬜️⬜️⬜️⬜️ | EnumHashSetMultimap | EnumMap<K, HashSet<V>> | | ⬜️⬜️⬜️⬜️⬜️ | EnumIndexSetMultimap | EnumMap<K, IndexSet<V>> | | ⬜️⬜️⬜️⬜️⬜️ | EnumVecMultimap | EnumMap<K, Vec<V>> | | ⬜️⬜️⬜️⬜️⬜️ | EnumEnumMultimap | EnumMap<K, EnumSet<V>> |

Multisets

| Completion | Name | Behaves as | | ---------- | ------------- | ------------------- | | ⬜️⬜️⬜️⬜️⬜️ | IndexMultiset | IndexMap<K,usize> | | ⬜️⬜️⬜️⬜️⬜️ | HashMultiset | HashMap<K,usize> | | ⬜️⬜️⬜️⬜️⬜️ | BTreeMultiset | BTreeMap<K,usize> | | ⬜️⬜️⬜️⬜️⬜️ | EnumMultiset | EnumMap<K,usize> |

Multimaps overview

| Method | HashSetMultimap | HashVecMultimap | IndexSetMultimap | IndexVecMultimap | | ------------------------------------- | --------------- | --------------- | ---------------- | ---------------- | | new() | ✅ | ✅ | ✅ | ✅ | | withkeycapacity() | ✅ | ✅ | ✅ | ✅ | | withhasher() | ✅ | ✅ | ✅ | ✅ | | withkeycapacityandhasher() | ✅ | ✅ | ✅ | ✅ | | keycapacity() | ✅ | ✅ | ✅ | ✅ | | keys() | ✅ | ✅ | ✅ | ✅ | | values() | ✅ | ✅ | ✅ | ✅ | | valuesmut() | maybe | maybe | maybe | maybe | | iter() | ✅ | ✅ | ✅ | ✅ | | len() | ✅ | ✅ | ✅ | ✅ | | isempty() | ✅ | ✅ | ✅ | ✅ | | keyslen() | ✅ | ✅ | ✅ | ✅ | | reserve() | ✅ | ✅ | ✅ | ✅ | | shrinkkeystofit() | ✅ | ✅ | ✅ | ✅ | | shrinkvaluestofit() | ✅ | ✅ | ✅ | ✅ | | shrinkkeysto() | planned | planned | - | - | | shrinkvaluesto() | planned | planned | - | planned | | entry() | planned | planned | planned | planned | | get() | ✅ | ✅ | ✅ | ✅ | | getkeyvalues() | ✅ | ✅ | ✅ | ✅ | | containskey() | ✅ | ✅ | ✅ | ✅ | | getmut() | maybe | maybe | maybe | maybe | | insert() | ✅ | ✅ | ✅ | ✅ | | removekey() | ✅ | ✅ | ✅ | ✅ | | removekeyentry() | ✅ | ✅ | ✅ | ✅ | | retain() | ✅ | ✅ | ✅ | ✅ | | intokeys() | ✅ | ✅ | ✅ | ✅ | | intovalues() | ✅ | ✅ | ✅ | ✅ | | remove() | ✅ | ✅ | ✅ | ✅ | | contains() | ✅ | ✅ | ✅ | ✅ | | asmap() | ✅ | ✅ | ✅ | ✅ | | intomap() | ✅ | ✅ | ✅ | ✅ | | IndexMap keys methods | | insertfull() | - | - | ✅ | ✅ | | getfull() | - | - | ✅ | ✅ | | getkeyindex() | - | - | ✅ | ✅ | | getfullmut() | - | - | maybe | maybe | | swapremove() | - | - | planned | planned | | swapremoveentry() | - | - | planned | planned | | swapremovefull() | - | - | planned | planned | | shiftremove() | - | - | planned | planned | | shiftremoveentry() | - | - | planned | planned | | shiftremovefull() | - | - | planned | planned | | pop() | - | - | planned | planned | | sortkeys() | - | - | planned | planned | | sortby() | - | - | planned | planned | | sortedby() | - | - | planned | planned | | reverse() | - | - | planned | planned | | getindex() | - | - | planned | planned | | getindexmut() | - | - | maybe | maybe | | first() | - | - | planned | planned | | firstmut() | - | - | maybe | maybe | | last() | - | - | planned | planned | | lastmut() | - | - | maybe | maybe | | swapremoveindex() | - | - | planned | planned | | shiftremoveindex() | - | - | planned | planned | | swapindices() | - | - | planned | planned | | Set values methods | | difference() | planned | - | planned | - | | symmetricdifference() | planned | - | planned | - | | intersection() | planned | - | planned | - | | union() | planned | - | planned | - | | isdisjoint() | planned | - | planned | - | | issubset() | planned | - | planned | - | | issuperset() | planned | - | planned | - | | Consistent ordered values methods | | sortvalues() | - | planned | planned | planned | | sortvaluesby() | - | planned | planned | planned | | TODO consider adding more mutators | | Traits | | Extend | ✅ | ✅ | ✅ | ✅ | | FromIterator | ✅ | ✅ | ✅ | ✅ | | From wrapped type | ✅ | ✅ | ✅ | ✅ | | IntoIterator | ✅ | ✅ | ✅ | ✅ | | Default | ✅ | ✅ | ✅ | ✅ | | Index | ✅ | ✅ | ✅ | ✅ | | Eq | ✅ | ✅ | ✅ | ✅ | | PartialEq | ✅ | ✅ | ✅ | ✅ | | Debug | ✅ | ✅ | ✅ | ✅ | | Clone | ✅ | ✅ | ✅ | ✅ | | Serializable | planned | planned | planned | planned | | Deserializable | planned | planned | planned | planned |

Todo