# Trait core::hash::Hash
[−]
[src]

```
pub trait Hash {
fn hash<H: Hasher>(&self, state: &mut H);
fn hash_slice<H: Hasher>(data: &[Self], state: &mut H) where Self: Sized { ... }
}
```

A hashable type.

The `H`

type parameter is an abstract hash state that is used by the `Hash`

to compute the hash.

If you are also implementing `Eq`

, there is an additional property that
is important:

```
k1 == k2 -> hash(k1) == hash(k2)
```

In other words, if two keys are equal, their hashes should also be equal.
`HashMap`

and `HashSet`

both rely on this behavior.

## Required Methods

`fn hash<H: Hasher>(&self, state: &mut H)`

Feeds this value into the state given, updating the hasher as necessary.

## Provided Methods

`fn hash_slice<H: Hasher>(data: &[Self], state: &mut H) where Self: Sized`

Feeds a slice of this type into the state provided.

## Implementors

`impl<T: Hash + Zeroable> Hash for NonZero<T>`

`impl<T: ?Sized> Hash for PhantomData<T>`

`impl Hash for TypeId`

`impl<T: Hash> Hash for [T; 0]`

`impl<T: Hash> Hash for [T; 1]`

`impl<T: Hash> Hash for [T; 2]`

`impl<T: Hash> Hash for [T; 3]`

`impl<T: Hash> Hash for [T; 4]`

`impl<T: Hash> Hash for [T; 5]`

`impl<T: Hash> Hash for [T; 6]`

`impl<T: Hash> Hash for [T; 7]`

`impl<T: Hash> Hash for [T; 8]`

`impl<T: Hash> Hash for [T; 9]`

`impl<T: Hash> Hash for [T; 10]`

`impl<T: Hash> Hash for [T; 11]`

`impl<T: Hash> Hash for [T; 12]`

`impl<T: Hash> Hash for [T; 13]`

`impl<T: Hash> Hash for [T; 14]`

`impl<T: Hash> Hash for [T; 15]`

`impl<T: Hash> Hash for [T; 16]`

`impl<T: Hash> Hash for [T; 17]`

`impl<T: Hash> Hash for [T; 18]`

`impl<T: Hash> Hash for [T; 19]`

`impl<T: Hash> Hash for [T; 20]`

`impl<T: Hash> Hash for [T; 21]`

`impl<T: Hash> Hash for [T; 22]`

`impl<T: Hash> Hash for [T; 23]`

`impl<T: Hash> Hash for [T; 24]`

`impl<T: Hash> Hash for [T; 25]`

`impl<T: Hash> Hash for [T; 26]`

`impl<T: Hash> Hash for [T; 27]`

`impl<T: Hash> Hash for [T; 28]`

`impl<T: Hash> Hash for [T; 29]`

`impl<T: Hash> Hash for [T; 30]`

`impl<T: Hash> Hash for [T; 31]`

`impl<T: Hash> Hash for [T; 32]`

`impl<T: Hash> Hash for Option<T>`

`impl<T: Hash, E: Hash> Hash for Result<T, E>`

`impl Hash for u8`

`impl Hash for u16`

`impl Hash for u32`

`impl Hash for u64`

`impl Hash for usize`

`impl Hash for i8`

`impl Hash for i16`

`impl Hash for i32`

`impl Hash for i64`

`impl Hash for isize`

`impl Hash for bool`

`impl Hash for char`

`impl Hash for str`

`impl Hash for ()`

`impl<A: Hash> Hash for (A,)`

`impl<A: Hash, B: Hash> Hash for (A, B)`

`impl<A: Hash, B: Hash, C: Hash> Hash for (A, B, C)`

`impl<A: Hash, B: Hash, C: Hash, D: Hash> Hash for (A, B, C, D)`

`impl<A: Hash, B: Hash, C: Hash, D: Hash, E: Hash> Hash for (A, B, C, D, E)`

`impl<A: Hash, B: Hash, C: Hash, D: Hash, E: Hash, F: Hash> Hash for (A, B, C, D, E, F)`

`impl<A: Hash, B: Hash, C: Hash, D: Hash, E: Hash, F: Hash, G: Hash> Hash for (A, B, C, D, E, F, G)`

`impl<A: Hash, B: Hash, C: Hash, D: Hash, E: Hash, F: Hash, G: Hash, H: Hash> Hash for (A, B, C, D, E, F, G, H)`

`impl<A: Hash, B: Hash, C: Hash, D: Hash, E: Hash, F: Hash, G: Hash, H: Hash, I: Hash> Hash for (A, B, C, D, E, F, G, H, I)`

`impl<A: Hash, B: Hash, C: Hash, D: Hash, E: Hash, F: Hash, G: Hash, H: Hash, I: Hash, J: Hash> Hash for (A, B, C, D, E, F, G, H, I, J)`

`impl<A: Hash, B: Hash, C: Hash, D: Hash, E: Hash, F: Hash, G: Hash, H: Hash, I: Hash, J: Hash, K: Hash> Hash for (A, B, C, D, E, F, G, H, I, J, K)`

`impl<A: Hash, B: Hash, C: Hash, D: Hash, E: Hash, F: Hash, G: Hash, H: Hash, I: Hash, J: Hash, K: Hash, L: Hash> Hash for (A, B, C, D, E, F, G, H, I, J, K, L)`

`impl<T: Hash> Hash for [T]`

`impl<'a, T: ?Sized + Hash> Hash for &'a T`

`impl<'a, T: ?Sized + Hash> Hash for &'a mut T`

`impl<T> Hash for *const T`

`impl<T> Hash for *mut T`