Hash

Trait Hash 

Source
pub trait Hash {
    // Required method
    fn hash<H>(&self, state: &mut H)
       where H: Hasher;

    // Provided method
    fn hash_slice<H>(data: &[Self], state: &mut H)
       where H: Hasher,
             Self: Sized { ... }
}
Expand description

Custom trait to avoid issues like https://github.com/rust-lang/rust/issues/27108.

Required Methods§

Source

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

Provided Methods§

Source

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl Hash for bool

Source§

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

Source§

impl Hash for char

Source§

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

Source§

impl Hash for i8

Source§

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

Source§

fn hash_slice<H>(data: &[i8], state: &mut H)
where H: Hasher,

Source§

impl Hash for i16

Source§

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

Source§

fn hash_slice<H>(data: &[i16], state: &mut H)
where H: Hasher,

Source§

impl Hash for i32

Source§

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

Source§

fn hash_slice<H>(data: &[i32], state: &mut H)
where H: Hasher,

Source§

impl Hash for i64

Source§

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

Source§

fn hash_slice<H>(data: &[i64], state: &mut H)
where H: Hasher,

Source§

impl Hash for i128

Source§

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

Source§

fn hash_slice<H>(data: &[i128], state: &mut H)
where H: Hasher,

Source§

impl Hash for isize

Source§

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

Source§

fn hash_slice<H>(data: &[isize], state: &mut H)
where H: Hasher,

Source§

impl Hash for str

Source§

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

Source§

impl Hash for u8

Source§

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

Source§

fn hash_slice<H>(data: &[u8], state: &mut H)
where H: Hasher,

Source§

impl Hash for u16

Source§

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

Source§

fn hash_slice<H>(data: &[u16], state: &mut H)
where H: Hasher,

Source§

impl Hash for u32

Source§

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

Source§

fn hash_slice<H>(data: &[u32], state: &mut H)
where H: Hasher,

Source§

impl Hash for u64

Source§

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

Source§

fn hash_slice<H>(data: &[u64], state: &mut H)
where H: Hasher,

Source§

impl Hash for u128

Source§

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

Source§

fn hash_slice<H>(data: &[u128], state: &mut H)
where H: Hasher,

Source§

impl Hash for ()

Source§

fn hash<H>(&self, _state: &mut H)
where H: Hasher,

Source§

impl Hash for usize

Source§

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

Source§

fn hash_slice<H>(data: &[usize], state: &mut H)
where H: Hasher,

Source§

impl Hash for String

Source§

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

Source§

impl<A> Hash for (A,)
where A: Hash + ?Sized,

Source§

fn hash<S>(&self, state: &mut S)
where S: Hasher,

Source§

impl<A, B> Hash for (A, B)
where A: Hash, B: Hash + ?Sized,

Source§

fn hash<S>(&self, state: &mut S)
where S: Hasher,

Source§

impl<A, B, C> Hash for (A, B, C)
where A: Hash, B: Hash, C: Hash + ?Sized,

Source§

fn hash<S>(&self, state: &mut S)
where S: Hasher,

Source§

impl<A, B, C, D> Hash for (A, B, C, D)
where A: Hash, B: Hash, C: Hash, D: Hash + ?Sized,

Source§

fn hash<S>(&self, state: &mut S)
where S: Hasher,

Source§

impl<A, B, C, D, E> Hash for (A, B, C, D, E)
where A: Hash, B: Hash, C: Hash, D: Hash, E: Hash + ?Sized,

Source§

fn hash<S>(&self, state: &mut S)
where S: Hasher,

Source§

impl<A, B, C, D, E, F> Hash for (A, B, C, D, E, F)
where A: Hash, B: Hash, C: Hash, D: Hash, E: Hash, F: Hash + ?Sized,

Source§

fn hash<S>(&self, state: &mut S)
where S: Hasher,

Source§

impl<A, B, C, D, E, F, G> Hash for (A, B, C, D, E, F, G)
where A: Hash, B: Hash, C: Hash, D: Hash, E: Hash, F: Hash, G: Hash + ?Sized,

Source§

fn hash<S>(&self, state: &mut S)
where S: Hasher,

Source§

impl<A, B, C, D, E, F, G, H> Hash for (A, B, C, D, E, F, G, H)
where A: Hash, B: Hash, C: Hash, D: Hash, E: Hash, F: Hash, G: Hash, H: Hash + ?Sized,

Source§

fn hash<S>(&self, state: &mut S)
where S: Hasher,

Source§

impl<A, B, C, D, E, F, G, H, I> Hash for (A, B, C, D, E, F, G, H, I)
where A: Hash, B: Hash, C: Hash, D: Hash, E: Hash, F: Hash, G: Hash, H: Hash, I: Hash + ?Sized,

Source§

fn hash<S>(&self, state: &mut S)
where S: Hasher,

Source§

impl<A, B, C, D, E, F, G, H, I, J> Hash for (A, B, C, D, E, F, G, H, I, J)
where A: Hash, B: Hash, C: Hash, D: Hash, E: Hash, F: Hash, G: Hash, H: Hash, I: Hash, J: Hash + ?Sized,

Source§

fn hash<S>(&self, state: &mut S)
where S: Hasher,

Source§

impl<A, B, C, D, E, F, G, H, I, J, K> Hash for (A, B, C, D, E, F, G, H, I, J, K)
where A: Hash, B: Hash, C: Hash, D: Hash, E: Hash, F: Hash, G: Hash, H: Hash, I: Hash, J: Hash, K: Hash + ?Sized,

Source§

fn hash<S>(&self, state: &mut S)
where S: Hasher,

Source§

impl<A, B, C, D, E, F, G, H, I, J, K, L> Hash for (A, B, C, D, E, F, G, H, I, J, K, L)
where A: Hash, B: Hash, C: Hash, D: Hash, E: Hash, F: Hash, G: Hash, H: Hash, I: Hash, J: Hash, K: Hash, L: Hash + ?Sized,

Source§

fn hash<S>(&self, state: &mut S)
where S: Hasher,

Source§

impl<T> Hash for *const T
where T: ?Sized,

Source§

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

Source§

impl<T> Hash for *mut T
where T: ?Sized,

Source§

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

Source§

impl<T> Hash for &T
where T: Hash + ?Sized,

Source§

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

Source§

impl<T> Hash for &mut T
where T: Hash + ?Sized,

Source§

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

Source§

impl<T> Hash for [T]
where T: Hash,

Source§

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

Source§

impl<T> Hash for Vec<T>
where T: Hash,

Source§

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

Implementors§