Skip to main content

BitHash

Trait BitHash 

pub trait BitHash {
    // Required method
    fn bit_hash<H>(&self, state: &mut H)
       where H: Hasher;
}
Expand description

A hash implementation for types which normally wouldn’t have one, implemented using a hash of the bitwise equivalent types when needed.

If a type is BitHash and BitEq, then it is important that the following property holds:

k1 biteq k2 -> bithash(k1) == bithash(k2)

See the docs on Hash for more information.

Useful for creating caches based on exact values. See the module level docs for more information.

Required Methods§

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

Feeds this value into the given Hasher.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

§

impl BitHash for ColorStop

§

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

§

impl BitHash for ColorStops

§

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

§

impl BitHash for GradientCacheKey

§

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

§

impl BitHash for GradientCacheKey

§

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

§

impl BitHash for f32

§

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

§

impl<T, const N: usize> BitHash for [T; N]
where T: BitHash,

§

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

§

impl<T> BitHash for &T
where T: BitHash,

§

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

§

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

§

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

Implementors§

§

impl BitHash for DynamicColor

§

impl<CS> BitHash for AlphaColor<CS>

§

impl<CS> BitHash for OpaqueColor<CS>

§

impl<CS> BitHash for PremulColor<CS>