pub trait MinMax {
// Required methods
fn min(self, other: Self) -> Self;
fn max(self, other: Self) -> Self;
fn clamp(self, min: Self, max: Self) -> Self;
}
Expand description
Provides min
, max
, and clamp
that are not necessarily consistent with
those from Ord
. This is provided because f32
and f64
do not implement
Ord
, so this trait is defined to give a uniform interface with Ord
types.
Required Methods§
fn min(self, other: Self) -> Self
fn max(self, other: Self) -> Self
fn clamp(self, min: Self, max: Self) -> Self
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.