Caching values is a typical use case for maps because even a large number of items won't affect the performance much, since the keys are always distinct. These keys can even carry information themselves!
For the use case defined in the last section, each customer uses postcodes within a country to identify locations; they typically cover an area that only holds a single office. Postal codes are stored as strings to cover the real world's wide variety of systems, and they are unique per country.
Thanks to a previous generic implementation, the entire LocationCache type can be an alias to a specialized HashMap, only requiring the hash function to be supplied on creation, shown as follows:
pub type LocationCache = HashMap<String, LocationInformation>;
The HashMap itself is a custom implementation that contains a key of type K, which has to also implement PartialEq (for comparing key instances directly), and Clone (for practical reasons).