pub trait Clamp: Sized + PartialOrd {
// Required methods
fn clamp_min() -> Self;
fn clamp_max() -> Self;
fn is_clamp_nan(&self) -> bool;
// Provided method
fn clamp(self) -> Self { ... }
}Expand description
Trait for scalar values which have a “clamped” range.
For integer values, the clamped range is from 0 to $ty::MAX.
For floating point values, the clamped range is from 0.0 to 1.0.
Required Methods§
Provided Methods§
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.