Rust Standard Library Cookbook
上QQ阅读APP看书,第一时间看更新

Using a HashMap

If you imagine a Vec as a collection that assigns an index (0, 1, 2, and so on) to data, the HashMap is a collection that assigns any data to any data. It allows you to map arbitrary, hashable data to other arbitrary data. Hashing and mapping, that's where the name comes from!