Trait

std::hash::Hash

source

Re-exported from core::hash::Hash.

forall Self.
trait Hash {
    /// The state with `self` written, and `self` handed back.
    fn hash(self: Self, state: HashState) -> (Self, HashState);
}

Hashing: a value writes its encoding into a running HashState and is handed back, so a linear key is not consumed.

Methods

method hashsource

fn hash(self: Self, state: HashState) -> (Self, HashState);

The state with self written, and self handed back.

Implementors

instance Hash[u8]source

instance Hash[u8] { ... }

In std::hash.

A u8 hashes as its 64-bit value.

instance Hash[u16]source

instance Hash[u16] { ... }

In std::hash.

A u16 hashes as its 64-bit value.

instance Hash[u32]source

instance Hash[u32] { ... }

In std::hash.

A u32 hashes as its 64-bit value.

instance Hash[u64]source

instance Hash[u64] { ... }

In std::hash.

A u64 hashes as its 64-bit value.

instance Hash[usize]source

instance Hash[usize] { ... }

In std::hash.

A usize hashes as its 64-bit value.

instance Hash[i8]source

instance Hash[i8] { ... }

In std::hash.

A i8 hashes as its 64-bit value.

instance Hash[i16]source

instance Hash[i16] { ... }

In std::hash.

A i16 hashes as its 64-bit value.

instance Hash[i32]source

instance Hash[i32] { ... }

In std::hash.

A i32 hashes as its 64-bit value.

instance Hash[i64]source

instance Hash[i64] { ... }

In std::hash.

A i64 hashes as its 64-bit value.

instance Hash[isize]source

instance Hash[isize] { ... }

In std::hash.

A isize hashes as its 64-bit value.

instance Hash[bool]source

instance Hash[bool] { ... }

In std::hash.

A bool hashes as 0 or 1.

instance Hash[(A, B)]source

forall A, B where Hash[A], Hash[B].
instance Hash[(A, B)] { ... }

In std::hash.

A pair hashes its parts in order.

instance Hash[(A, B, D)]source

forall A, B, D where Hash[A], Hash[B], Hash[D].
instance Hash[(A, B, D)] { ... }

In std::hash.

A triple hashes its parts in order.

instance Hash[Readable[C, S]]source

forall C, S where ReadBytes[C, S], Copy[S].
instance Hash[Readable[C, S]] { ... }

In std::slice.

A readable view hashes its bytes (hash_bytes).

instance Hash[Buffer!]source

instance Hash[Buffer!] { ... }

In std::buffer.

Hashes the buffer's bytes in order.

A buffer hashes and compares by its contents, so it can key a map.