1.0.0[][src]Module boolean_enums::lstd::cmp

Functionality for ordering and comparison.

This module defines both PartialOrd and PartialEq traits which are used by the compiler to implement comparison operators. Rust programs may implement PartialOrd to overload the <, <=, >, and >= operators, and may implement PartialEq to overload the == and != operators.

Examples

let x: u32 = 0;
let y: u32 = 1;

// these two lines are equivalent
assert_eq!(x < y, true);
assert_eq!(x.lt(&y), true);

// these two lines are also equivalent
assert_eq!(x == y, false);
assert_eq!(x.eq(&y), false);

Structs

Reverse

A helper struct for reverse ordering.

Enums

Ordering

An Ordering is the result of a comparison between two values.

Functions

max

Compares and returns the maximum of two values.

min

Compares and returns the minimum of two values.