Trait num_order::NumHash

source ·
pub trait NumHash {
    // Required method
    fn num_hash<H: Hasher>(&self, state: &mut H);
}
Expand description

Consistent hash implementation among different numeric types.

It’s ensured that if a.num_eq(b), then a and b will result in the same hash. Although the other direction is not ensured because it’s infeasible, the hash function is still designed to be as sparse as possible.

Required Methods§

source

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

Consistent Hash::hash on different numeric types.

This function will ensures if a.num_eq(b), then a.num_hash() and b.num_hash() manipulate the state in the same way.

Implementations on Foreign Types§

source§

impl NumHash for Ratio<BigInt>

source§

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

source§

impl NumHash for i8

source§

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

source§

impl NumHash for BigUint

source§

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

source§

impl NumHash for Ratio<i8>

source§

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

source§

impl NumHash for Ratio<i128>

source§

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

source§

impl NumHash for Ratio<i32>

source§

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

source§

impl NumHash for i64

source§

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

source§

impl NumHash for isize

source§

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

source§

impl NumHash for Ratio<i64>

source§

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

source§

impl NumHash for u8

source§

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

source§

impl NumHash for i128

source§

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

source§

impl NumHash for Ratio<i16>

source§

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

source§

impl NumHash for i16

source§

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

source§

impl NumHash for usize

source§

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

source§

impl NumHash for Complex<f32>

source§

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

source§

impl NumHash for u64

source§

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

source§

impl NumHash for f32

source§

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

source§

impl NumHash for Complex<f64>

source§

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

source§

impl NumHash for f64

source§

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

source§

impl NumHash for Ratio<isize>

source§

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

source§

impl NumHash for BigInt

source§

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

source§

impl NumHash for u32

source§

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

source§

impl NumHash for u128

source§

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

source§

impl NumHash for u16

source§

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

source§

impl NumHash for i32

source§

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

Implementors§