pub trait TotalOrder: PartialOrder { }
Expand description
A type that is totally ordered.
This trait is a “carrier trait”, in the sense that it adds no additional functionality
over PartialOrder
, but instead indicates that the less_than
and less_equal
methods
are total, meaning that x.less_than(&y)
is equivalent to !y.less_equal(&x)
.
This trait is distinct from Rust’s Ord
trait, because several implementors of
PartialOrd
also implement Ord
for efficient canonicalization, deduplication,
and other sanity-maintaining operations.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.