Module std::cmp
[−]
[src]
Functionality for ordering and comparison.
This module defines both PartialOrd
`PartialOrdand
` and PartialEq
`PartialEqtraits which are used by the compiler to implement comparison operators. Rust programs may implement
` traits which are used by the compiler to
implement comparison operators. Rust programs may implement PartialOrd
`PartialOrdto overload the
` to overload the <
`<,
`,
<=
`<=,
`, >
`>, and
`, and >=
`>=operators, and may implement
` operators, and may implement PartialEq
`PartialEqto overload the
` to overload the ==
`==and
` and !=
`!=`
operators.
Enums
Ordering |
An |
Traits
Eq |
Trait for equality comparisons which are equivalence relations. |
Ord |
Trait for types that form a total order. |
PartialEq |
Trait for equality comparisons which are partial equivalence relations. |
PartialOrd |
Trait for values that can be compared for a sort-order. |
Functions
max |
Compare and return the maximum of two values. |
min |
Compare and return the minimum of two values. |
partial_max |
[Unstable] Compare and return the maximum of two values if there is one. |
partial_min |
[Unstable] Compare and return the minimum of two values if there is one. |