pub trait Hashable {
    type Output: Into<u64> + Copy + Ord;

    // Required method
    fn hashed(&self) -> Self::Output;
}
Expand description

Types with a hashed method, producing an unsigned output of some type.

The output type may vary from a u8 up to a u64, allowing types with simple keys to communicate this through their size. Certain algorithms, for example radix sorting, can take advantage of the smaller size.

Required Associated Types§

source

type Output: Into<u64> + Copy + Ord

The type of the output value.

Required Methods§

source

fn hashed(&self) -> Self::Output

A well-distributed integer derived from the data.

Implementors§

source§

impl<T: Hash + Hashable> Hashable for HashWrapper<T>

§

type Output = <T as Hashable>::Output

source§

impl<T: Hash> Hashable for T

§

type Output = u64