Expand description
Utilities for comparing and ordering values.
This module contains various tools for comparing and ordering values. In summary:
- Eqand- PartialEqare traits that allow you to define total and partial equality between values, respectively. Implementing them overloads the- ==and- !=operators.
- Ordand- PartialOrdare traits that allow you to define total and partial orderings between values, respectively. Implementing them overloads the- <,- <=,- >, and- >=operators.
- Orderingis an enum returned by the main functions of- Ordand- PartialOrd, and describes an ordering.
- Reverseis a struct that allows you to easily reverse an ordering.
- maxand- minare functions that build off of- Ordand allow you to find the maximum or minimum of two values.
For more details, see the respective documentation of each item in the list.
Macros
- Derive macro generating an impl of the traitEq.
- Derive macro generating an impl of the traitOrd.
- Derive macro generating an impl of the traitPartialEq.
- Derive macro generating an impl of the traitPartialOrd.
Structs
- A helper struct for reverse ordering.
Enums
- AnOrderingis the result of a comparison between two values.
Traits
- Trait for equality comparisons which are equivalence relations.
- Trait for types that form a total order.
- Trait for equality comparisons.
- Trait for types that form a partial order.
Functions
- Compares and returns the maximum of two values.
- Returns the maximum of two values with respect to the specified comparison function.
- Returns the element that gives the maximum value from the specified function.
- Compares and returns the minimum of two values.
- Returns the minimum of two values with respect to the specified comparison function.
- Returns the element that gives the minimum value from the specified function.