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 core::hash.
A u8 hashes as its 64-bit value.
instance Hash[u16]source
instance Hash[u16] { ... }
In core::hash.
A u16 hashes as its 64-bit value.
instance Hash[u32]source
instance Hash[u32] { ... }
In core::hash.
A u32 hashes as its 64-bit value.
instance Hash[u64]source
instance Hash[u64] { ... }
In core::hash.
A u64 hashes as its 64-bit value.
instance Hash[usize]source
instance Hash[usize] { ... }
In core::hash.
A usize hashes as its 64-bit value.
instance Hash[i8]source
instance Hash[i8] { ... }
In core::hash.
A i8 hashes as its 64-bit value.
instance Hash[i16]source
instance Hash[i16] { ... }
In core::hash.
A i16 hashes as its 64-bit value.
instance Hash[i32]source
instance Hash[i32] { ... }
In core::hash.
A i32 hashes as its 64-bit value.
instance Hash[i64]source
instance Hash[i64] { ... }
In core::hash.
A i64 hashes as its 64-bit value.
instance Hash[isize]source
instance Hash[isize] { ... }
In core::hash.
A isize hashes as its 64-bit value.
instance Hash[bool]source
instance Hash[bool] { ... }
In core::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 core::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 core::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 core::slice.
A readable view hashes its bytes (hash_bytes).
instance Hash[Buffer!]source
instance Hash[Buffer!] { ... }
In alloc::buffer.
Hashes the buffer's bytes in order.
A buffer hashes and compares by its contents, so it can key a map.