pub trait PartialOrder<Rhs: ?Sized = Self>: PartialEq<Rhs> {
// Required method
fn less_equal(&self, other: &Rhs) -> bool;
// Provided method
fn less_than(&self, other: &Rhs) -> bool { ... }
}Expand description
A type that is partially ordered.
This trait is distinct from Rust’s PartialOrd trait, because the implementation
of that trait precludes a distinct Ord implementation. We need an independent
trait if we want to have a partially ordered type that can also be sorted.
The partial order should be consistent with Eq, in the sense that if a == b then
a.less_equal(b) and b.less_equal(a).
Required Methods§
Sourcefn less_equal(&self, other: &Rhs) -> bool
fn less_equal(&self, other: &Rhs) -> bool
Returns true iff one element is less than or equal to the other.