Trait BitEq

Source
pub trait BitEq {
    // Required method
    fn bit_eq(&self, other: &Self) -> bool;
}
Expand description

An equivalence relation for types which normally wouldn’t have one, implemented using a bitwise comparison for floating point values.

See the docs on Eq for more information.

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

Required Methods§

Source

fn bit_eq(&self, other: &Self) -> bool

Returns true if self is equal to other.

This need not use the semantically natural comparison operation for the type; indeed floating point types should implement this by comparing bit values.

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 BitEq for f32

Source§

fn bit_eq(&self, other: &Self) -> bool

Source§

impl<T: BitEq> BitEq for &T

Source§

fn bit_eq(&self, other: &Self) -> bool

Source§

impl<T: BitEq> BitEq for [T]

Source§

fn bit_eq(&self, other: &Self) -> bool

Source§

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

Source§

fn bit_eq(&self, other: &Self) -> bool

Implementors§

Source§

impl BitEq for DynamicColor

Source§

impl<CS> BitEq for AlphaColor<CS>

Source§

impl<CS> BitEq for OpaqueColor<CS>

Source§

impl<CS> BitEq for PremulColor<CS>