Collectables: Rust crate of collections helpers
This collectables
Rust crate provides helpers
for BTreeMap, BTreeSet, HashMapSet, etc. By SixArm.com.
This crate provides two general-purpose collections helpers:
-
BTreeMapToSet<K, V> is based on BTreeMap<K, BTreeSet>
-
HashMapToSet<K, V> is based on HashMap<K, HashSet>
Examples
Example that maps a word to a set of other words:
// Use this crate
use *;
// Create an empty hash map, where each vaue is a hash set.
let mut a: = new;
/// Create some example strings
let hello = String from; // English example
let ninhao = String from; // Chinese example
let hola = String from; // Spanish example
// Insert items, such as mapping the word "hello" to various tranlations.
// The first parameter is a map key; the second parameter is a set item.
a.sub_insert;
a.sub_insert;
// Does the collection contain a word map key to a word set item?
assert_eq!;
// Remove an item from the map key set.
a.sub_remove;
// These collections helpers are implemented as trait extensions,
// thus all HashMap functions and HashSet functions are available,
// and can be intermixed with the HashMapSet trait extensions.
assert_eq!;
## Specific-purpose collections helpers
This crate provides two specific-purpose collections helpers:
* BTreeMapOfFileLenToSetOfPathBuf is based on
* HashMapOfFileLenToSetOfPathBuf is based on
The helpers are implemented as
Tracking
Contact: Joel Parker Henderson joel@joelparkerhenderson.com
License: MIT or Apache-2.0 or GPL-2.0-only