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 |
ApproxEq | Trait for testing approximate equality |
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 |
Ord | Trait for values that can be compared for a sort-order. |
TotalEq | Trait for equality comparisons where |
TotalOrd | Trait for types that form a total order |
cmp2 | Compares (a1, b1) against (a2, b2), where the a values are more significant. |
lexical_ordering | Return |
max | |
min |
Prefix searches with a type followed by a colon (e.g.
fn:
) to restrict the search to a given type.
Accepted types are: fn
, mod
,
struct
(or str
), enum
,
trait
, typedef
(or
tdef
).