[src]

Trait std::cmp::Eq

pub trait Eq {
    fn eq(&self, other: &Self) -> bool;

    fn ne(&self, other: &Self) -> bool { ... }
}

Trait for values that can be compared for equality and inequality.

This trait allows partial equality, where types can be unordered instead of strictly equal or unequal. For example, with the built-in floating-point types a == b and a != b will both evaluate to false if either a or b is NaN (cf. IEEE 754-2008 section 5.11).

Eq only requires the eq method to be implemented; ne is its negation by default.

Eventually, this will be implemented by default for types that implement TotalEq.

Required Methods

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

Provided Methods

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

Implementors