Module

std::hash

source

Re-exported from core::hash.

Hashing and equality traits, and the keyed hash behind them.

Types

SeedThe 128-bit key of the hash: which of SipHash's functions every map made with it computes.
HashStateSipHash-1-3's running state: its four words, and how many words have been written.

Traits

HashHashing: a value writes its encoding into a running HashState and is handed back, so a linear key is not consumed.
EqEquality of an A with a B, handing both back so linear values can be compared.
HashInHashing and equality for a Copy key that points into a domain, read through that domain's capability C: a Str['t] read with an Exclusive!['t], say.

Functions

rotlx rotated left by r bits, 0 < r < 64.
key_hashA key's hash under HashIn and seed.
key_eqWhether two keys are equal under HashIn.

Instances

Hash[u8]A u8 hashes as its 64-bit value.
Eq[u8, u8]u8s are equal when their values are.
Hash[u16]A u16 hashes as its 64-bit value.
Eq[u16, u16]u16s are equal when their values are.
Hash[u32]A u32 hashes as its 64-bit value.
Eq[u32, u32]u32s are equal when their values are.
Hash[u64]A u64 hashes as its 64-bit value.
Eq[u64, u64]u64s are equal when their values are.
Hash[usize]A usize hashes as its 64-bit value.
Eq[usize, usize]usizes are equal when their values are.
Hash[i8]A i8 hashes as its 64-bit value.
Eq[i8, i8]i8s are equal when their values are.
Hash[i16]A i16 hashes as its 64-bit value.
Eq[i16, i16]i16s are equal when their values are.
Hash[i32]A i32 hashes as its 64-bit value.
Eq[i32, i32]i32s are equal when their values are.
Hash[i64]A i64 hashes as its 64-bit value.
Eq[i64, i64]i64s are equal when their values are.
Hash[isize]A isize hashes as its 64-bit value.
Eq[isize, isize]isizes are equal when their values are.
Hash[bool]A bool hashes as 0 or 1.
Eq[bool, bool]bools are equal when their values are.
Hash[(A, B)]A pair hashes its parts in order.
Hash[(A, B, D)]A triple hashes its parts in order.
Eq[(A1, B1), (A2, B2)]Pairs are equal when their parts are, part by part.
Eq[(A1, B1, D1), (A2, B2, D2)]Triples are equal when their parts are, part by part.
HashIn[u8, C]A u8 key, under any capability: hashed and compared as Hash and Eq do.
HashIn[u16, C]A u16 key, under any capability: hashed and compared as Hash and Eq do.
HashIn[u32, C]A u32 key, under any capability: hashed and compared as Hash and Eq do.
HashIn[u64, C]A u64 key, under any capability: hashed and compared as Hash and Eq do.
HashIn[usize, C]A usize key, under any capability: hashed and compared as Hash and Eq do.
HashIn[i8, C]A i8 key, under any capability: hashed and compared as Hash and Eq do.
HashIn[i16, C]A i16 key, under any capability: hashed and compared as Hash and Eq do.
HashIn[i32, C]A i32 key, under any capability: hashed and compared as Hash and Eq do.
HashIn[i64, C]A i64 key, under any capability: hashed and compared as Hash and Eq do.
HashIn[isize, C]A isize key, under any capability: hashed and compared as Hash and Eq do.
HashIn[bool, C]A bool key, under any capability: hashed and compared as Hash and Eq do.
HashIn[(A, B), C]A pair key: its parts hashed and compared in order, each under cx.
HashIn[(A, B, D), C]A triple key: its parts hashed and compared in order, each under cx.

Function declarations

fn rotlsource

fn rotl(x: u64, r: u64) -> u64 { ... }

x rotated left by r bits, 0 < r < 64.

fn key_hashsource

forall K, C where HashIn[K, C].
fn key_hash(&cx: C, key: K, seed: Seed) -> u64 { ... }

A key's hash under HashIn and seed.

fn key_eqsource

forall K, C where HashIn[K, C].
fn key_eq(&cx: C, a: K, b: K) -> bool { ... }

Whether two keys are equal under HashIn.

Instance declarations

instance Hash[u8]source

instance Hash[u8] { ... }

A u8 hashes as its 64-bit value.

instance Eq[u8, u8]source

instance Eq[u8, u8] { ... }

u8s are equal when their values are.

instance Hash[u16]source

instance Hash[u16] { ... }

A u16 hashes as its 64-bit value.

instance Eq[u16, u16]source

instance Eq[u16, u16] { ... }

u16s are equal when their values are.

instance Hash[u32]source

instance Hash[u32] { ... }

A u32 hashes as its 64-bit value.

instance Eq[u32, u32]source

instance Eq[u32, u32] { ... }

u32s are equal when their values are.

instance Hash[u64]source

instance Hash[u64] { ... }

A u64 hashes as its 64-bit value.

instance Eq[u64, u64]source

instance Eq[u64, u64] { ... }

u64s are equal when their values are.

instance Hash[usize]source

instance Hash[usize] { ... }

A usize hashes as its 64-bit value.

instance Eq[usize, usize]source

instance Eq[usize, usize] { ... }

usizes are equal when their values are.

instance Hash[i8]source

instance Hash[i8] { ... }

A i8 hashes as its 64-bit value.

instance Eq[i8, i8]source

instance Eq[i8, i8] { ... }

i8s are equal when their values are.

instance Hash[i16]source

instance Hash[i16] { ... }

A i16 hashes as its 64-bit value.

instance Eq[i16, i16]source

instance Eq[i16, i16] { ... }

i16s are equal when their values are.

instance Hash[i32]source

instance Hash[i32] { ... }

A i32 hashes as its 64-bit value.

instance Eq[i32, i32]source

instance Eq[i32, i32] { ... }

i32s are equal when their values are.

instance Hash[i64]source

instance Hash[i64] { ... }

A i64 hashes as its 64-bit value.

instance Eq[i64, i64]source

instance Eq[i64, i64] { ... }

i64s are equal when their values are.

instance Hash[isize]source

instance Hash[isize] { ... }

A isize hashes as its 64-bit value.

instance Eq[isize, isize]source

instance Eq[isize, isize] { ... }

isizes are equal when their values are.

instance Hash[bool]source

instance Hash[bool] { ... }

A bool hashes as 0 or 1.

instance Eq[bool, bool]source

instance Eq[bool, bool] { ... }

bools are equal when their values are.

instance Hash[(A, B)]source

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

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)] { ... }

A triple hashes its parts in order.

instance Eq[(A1, B1), (A2, B2)]source

forall A1, B1, A2, B2 where Eq[A1, A2], Eq[B1, B2].
instance Eq[(A1, B1), (A2, B2)] { ... }

Pairs are equal when their parts are, part by part.

instance Eq[(A1, B1, D1), (A2, B2, D2)]source

forall A1, B1, D1, A2, B2, D2 where Eq[A1, A2], Eq[B1, B2], Eq[D1, D2].
instance Eq[(A1, B1, D1), (A2, B2, D2)] { ... }

Triples are equal when their parts are, part by part.

instance HashIn[u8, C]source

forall C.
instance HashIn[u8, C] { ... }

A u8 key, under any capability: hashed and compared as Hash and Eq do.

instance HashIn[u16, C]source

forall C.
instance HashIn[u16, C] { ... }

A u16 key, under any capability: hashed and compared as Hash and Eq do.

instance HashIn[u32, C]source

forall C.
instance HashIn[u32, C] { ... }

A u32 key, under any capability: hashed and compared as Hash and Eq do.

instance HashIn[u64, C]source

forall C.
instance HashIn[u64, C] { ... }

A u64 key, under any capability: hashed and compared as Hash and Eq do.

instance HashIn[usize, C]source

forall C.
instance HashIn[usize, C] { ... }

A usize key, under any capability: hashed and compared as Hash and Eq do.

instance HashIn[i8, C]source

forall C.
instance HashIn[i8, C] { ... }

A i8 key, under any capability: hashed and compared as Hash and Eq do.

instance HashIn[i16, C]source

forall C.
instance HashIn[i16, C] { ... }

A i16 key, under any capability: hashed and compared as Hash and Eq do.

instance HashIn[i32, C]source

forall C.
instance HashIn[i32, C] { ... }

A i32 key, under any capability: hashed and compared as Hash and Eq do.

instance HashIn[i64, C]source

forall C.
instance HashIn[i64, C] { ... }

A i64 key, under any capability: hashed and compared as Hash and Eq do.

instance HashIn[isize, C]source

forall C.
instance HashIn[isize, C] { ... }

A isize key, under any capability: hashed and compared as Hash and Eq do.

instance HashIn[bool, C]source

forall C.
instance HashIn[bool, C] { ... }

A bool key, under any capability: hashed and compared as Hash and Eq do.

instance HashIn[(A, B), C]source

forall A, B, C where HashIn[A, C], HashIn[B, C], Copy[A], Copy[B].
instance HashIn[(A, B), C] { ... }

A pair key: its parts hashed and compared in order, each under cx.

instance HashIn[(A, B, D), C]source

forall A, B, D, C where HashIn[A, C], HashIn[B, C], HashIn[D, C], Copy[A], Copy[B], Copy[D].
instance HashIn[(A, B, D), C] { ... }

A triple key: its parts hashed and compared in order, each under cx.