As mentioned earlier, a HashMap is a collection to map one type of data to another. You do this by calling insert, and passing your key and its value [9]. If the key already had a value, it will be overwritten. This is why insert returns an Option: if there was a value before, it returns the old value [27], or otherwise None. If you want to make sure that you're not overwriting anything, make sure to check the result of contains_key [16] before inserting your value.
Both get and remove won't crash when called with an invalid key. Instead, they return a Result. In the case of remove, said Result contains the removed value.
As with most collections, you have the options to iterate over your data, by borrowing the key-value pairs[43], borrowing the keys while mutating the values [49], or moving them all [55]. Due to its nature, HashMap additionally allows you three more options: borrowing all values [74], mutating all values [80], or borrowing all keys [68]. You...