[src]

Module std::cmp

The Ord and Eq comparison traits

This module contains the definition of both Ord and Eq which define the common interfaces for doing comparison. Both are language items that the compiler uses to implement the comparison operators. Rust code may implement Ord to overload the <, <=, >, and >= operators, and Eq to overload the == and != operators.

Ordering
Eq

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

Equiv

The equivalence relation. Two values may be equivalent even if they are of different types. The most common use case for this relation is container types; e.g. it is often desirable to be able to use &str values to look up entries in a container with ~str keys.

Ord

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

TotalEq

Trait for equality comparisons where a == b and a != b are strict inverses.

TotalOrd

Trait for types that form a total order

lexical_ordering

Return o1 if it is not Equal, otherwise o2. Simulates the lexical ordering on a type (int, int).

max
min