Result of comparing two values.
Example
use std::cmp::Ordering;
assert_eq!(1.compare(&2), Ordering::Less);
assert_eq!(2.compare(&1), Ordering::Greater);
assert_eq!(2.compare(&2), Ordering::Equal);
Run this example
Variants
-
Less
The left value is less than the right value.
-
Equal
The left value is equal to the right value.
-
Greater
The left value is greater than the right value.