pub trait TryOrd: TryEq + TryPartialOrd<Self> {
// Required method
fn try_cmp(&self, other: &Self) -> Result<Ordering, Self::Error>;
// Provided methods
fn try_max(self, other: Self) -> Result<Self, Self::Error>
where Self: Sized { ... }
fn try_min(self, other: Self) -> Result<Self, Self::Error>
where Self: Sized { ... }
fn try_clamp(self, min: Self, max: Self) -> Result<Self, Self::Error>
where Self: Sized { ... }
}
Expand description
The try trait for Ord
.
Required Methods§
Provided Methods§
Sourcefn try_max(self, other: Self) -> Result<Self, Self::Error>where
Self: Sized,
fn try_max(self, other: Self) -> Result<Self, Self::Error>where
Self: Sized,
The fallible equivalent of Ord::max
.
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.