struct HashMap<K, V, H = DefaultHash> { ... }
K: Hashable<K, H> + Equatable<K>
H: Hasher<H>

A map (dictionary) implemented as a hash table.

The implementation is a simple linear probing hash table. Keys must satisfy the Hashable and Equatable protocols. There are no restriction on the value type.

Example

Methods

impl HashMap<K, V, H = DefaultHash> { ... }
K: Hashable<K, H> + Equatable<K>
H: Hasher<H>

impl HashMap<B, K, V, H = DefaultHash> { ... }
B: Hashable<B, H> + Equatable<B>
K: Borrowable<K, B>
H: Hasher<H>

impl HashMap<K, V, I, H = DefaultHash> { ... }
K: Hashable<K, H> + Equatable<K>
I: Iterator<I, (K, V)>
H: Hasher<H>