Skip to main content

Module hasher

Module hasher 

Source
Expand description

Hashing and equality traits for keys.

A hash here yields a usize directly, matching a hash functor that returns a machine word. This lets an identity hash place a key in a known bucket, which the collision and precalculated-hash tests rely on.

StdHash is the default. It feeds the key to a core::hash::Hasher built by a core::hash::BuildHasher and truncates the 64-bit result to usize.

Structs§

FnHash
Adapt a plain closure Fn(&Q) -> usize into a HashKey.
StdEq
Equality by the standard PartialEq relation.
StdHash
A hasher built on the standard BuildHasher machinery.

Traits§

EqKey
Test two borrowed keys for equality.
HashKey
Produce a usize hash for a borrowed key Q.