Module hash
Generic hashing support.
This module provides a generic way to compute the hash of a value.
Hashes are most commonly used with HashMap and HashSet.
The simplest way to make a type hashable is to use #[derive(Hash)]:
Examples
use ;
let person1 = Person ;
let person2 = Person ;
assert!;
If you need more control over how a value is hashed, you need to implement
the Hash trait:
use ;
let person1 = Person ;
let person2 = Person ;
assert_eq!;
Structs
-
BuildHasherDefault
Used to create a default
BuildHasherinstance for types that implementHasherandDefault. - SipHasher An implementation of SipHash 2-4.
Traits
-
BuildHasher
A trait for creating instances of
Hasher. - Hash A hashable type.
- Hasher A trait for hashing an arbitrary stream of bytes.
Macros
-
Hash
Derive macro generating an impl of the trait
Hash.