[src]

Trait std::cmp::Ord

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

    fn le(&self, other: &Self) -> bool { ... }
    fn gt(&self, other: &Self) -> bool { ... }
    fn ge(&self, other: &Self) -> bool { ... }
}

Trait for values that can be compared for a sort-order.

Ord only requires implementation of the lt method, with the others generated from default implementations.

However it remains possible to implement the others separately, for compatibility with floating-point NaN semantics (cf. IEEE 754-2008 section 5.11).

Required Methods

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

Provided Methods

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

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

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

Implementors