#collection #multimap #found #map #set #heap #small-vec

more_collections

Additional collections not found in std::collections

22 releases (12 breaking)

0.13.6 Apr 15, 2024
0.13.4 Mar 22, 2024
0.12.0 Dec 22, 2023
0.10.0 Nov 21, 2023
0.1.0 Dec 24, 2021

#211 in Data structures

Download history 205/week @ 2024-01-23 82/week @ 2024-01-30 164/week @ 2024-02-06 201/week @ 2024-02-13 201/week @ 2024-02-20 114/week @ 2024-02-27 95/week @ 2024-03-05 87/week @ 2024-03-12 209/week @ 2024-03-19 35/week @ 2024-03-26 105/week @ 2024-04-02 235/week @ 2024-04-09 84/week @ 2024-04-16 29/week @ 2024-04-23 142/week @ 2024-04-30 60/week @ 2024-05-07

410 downloads per month

Apache-2.0

185KB
4.5K SLoC

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.

Completion Name Behaves as
🟩🟩🟨⬜️⬜️ SmallMap IndexMap<K, V>
🟩🟩🟨⬜️⬜️ SmallSet IndexSet<T>
⬜️⬜️⬜️⬜️⬜️ SmallSortedMap BTreeMap<K, V>
⬜️⬜️⬜️⬜️⬜️ SmallSortedSet BTreeSet<T>

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>>

A detailed overview.

VecMap

Completion Name Drop-in replacement for Implemented as Distinguishing features
🟩🟩🟩🟨⬜️ VecMap IndexMap<K,V> Vec<Option<T>> Fast random access

Click here for a detailed description and overview of the API.

Multisets

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

Some work is already done in this PR.

Dependencies

~185KB