hashvec
A HashVec is a hash map / dictionary whose key-value pairs are stored (and can be iterated over) in a fixed order, by default the order in which they were inserted into the map. It's essentially a vector whose values can be inserted/retrieved with keys.
Example
use *;
// Create a new hashvec containing pairs of animal names and species
// The hashvec! macro acts like vec!, but with key-value tuple pairs
let mut hashvec: = hashvec!;
// Insert a value into the hashvec (HashMap-style)
// Inserting overwrites existing keys' entries in-place
hashvec.insert;
// Push a value onto the hashvec (Vector-style)
// Pushing overwrites existing keys' entries and moves them to the end
hashvec.push;
// Access a value by key
match hashvec.get
// Access an entry by index
let lee_value = hashvec;
assert_eq!;
// Get the index of a key
let lee_index = hashvec.index.unwrap;
assert_eq!;
// Get the length of the hashvec
let hashvec_length = hashvec.len;
assert_eq!;
// Change an entry's key in-place
hashvec.rename;
assert_eq!;
// Mutate a value
match hashvec.get_mut
assert_eq!;
// Remove an entry
hashvec.remove_key;
assert_eq!;
// Swap the locations of two entries by their keys
hashvec.swap_keys;
assert_eq!;
assert_eq!;
// Now swap them again, by their indices
hashvec.swap_indices;
assert_eq!;
assert_eq!;
// Iterate over each of the key-value pairs in the hashvec
for in hashvec.into_iter
// Remove an entry from the end of the hashvec
let last_entry = hashvec.pop;
assert_eq!;
// Clear the hashvec
hashvec.clear;