Trait RefHash

Source
pub trait RefHash {
    // Required method
    fn ref_hash<H: Hasher>(&self, hasher: &mut H);
}
Expand description

Hashes the pointer to the object instead of the object itself.

This trait works exatly like Hash, the only difference being that it hashes the pointer.

Required Methods§

Source

fn ref_hash<H: Hasher>(&self, hasher: &mut H)

Feeds the value into the hasher.

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<'a, T> RefHash for &'a T

Source§

fn ref_hash<H: Hasher>(&self, hasher: &mut H)

Source§

impl<T> RefHash for Rc<T>

Source§

fn ref_hash<H: Hasher>(&self, hasher: &mut H)

Source§

impl<T> RefHash for Arc<T>

Source§

fn ref_hash<H: Hasher>(&self, hasher: &mut H)

Implementors§