pub trait TotalOrd: TotalEq {
// Required method
fn tot_cmp(&self, other: &Self) -> Ordering;
// Provided methods
fn tot_lt(&self, other: &Self) -> bool { ... }
fn tot_gt(&self, other: &Self) -> bool { ... }
fn tot_le(&self, other: &Self) -> bool { ... }
fn tot_ge(&self, other: &Self) -> bool { ... }
}
Expand description
Alternative trait for Ord. By consistently using this we can still be generic w.r.t Ord while getting a total ordering for floats.
Required Methods§
Provided Methods§
fn tot_lt(&self, other: &Self) -> bool
fn tot_gt(&self, other: &Self) -> bool
fn tot_le(&self, other: &Self) -> bool
fn tot_ge(&self, other: &Self) -> bool
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.