pub trait MinMax: PartialOrd + IsNonCmpValue {
// Provided methods
fn min(self, other: Self) -> Self
where Self: Sized { ... }
fn max(self, other: Self) -> Self
where Self: Sized { ... }
fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized { ... }
fn min_opt(self, other: Option<Self>) -> Option<Self>
where Self: Sized { ... }
fn max_opt(self, other: Option<Self>) -> Option<Self>
where Self: Sized { ... }
fn clamp_opt(self, min: Option<Self>, max: Option<Self>) -> Option<Self>
where Self: Sized { ... }
}Provided Methods§
fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized,
fn min_opt(self, other: Option<Self>) -> Option<Self>where
Self: Sized,
fn max_opt(self, other: Option<Self>) -> Option<Self>where
Self: Sized,
fn clamp_opt(self, min: Option<Self>, max: Option<Self>) -> Option<Self>where
Self: Sized,
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.