pub trait UnitIntervalFloat:
Sealed
+ Copy
+ PartialOrd
+ Add<Output = Self>
+ Sub<Output = Self>
+ Mul<Output = Self>
+ Div<Output = Self> {
const ZERO: Self;
const NEG_ONE: Self;
const ONE: Self;
const HALF: Self;
// Required methods
fn clamp_unit(self) -> Self;
fn clamp_signed_unit(self) -> Self;
}Expand description
Floating-point support required by UnitInterval.
This trait is sealed and implemented only for f32 and f64.
Required Associated Constants§
Required Methods§
Sourcefn clamp_unit(self) -> Self
fn clamp_unit(self) -> Self
Clamps a value into [0, 1].
Implementations treat NaN as zero.
Sourcefn clamp_signed_unit(self) -> Self
fn clamp_signed_unit(self) -> Self
Clamps a value into [-1, 1].
Implementations treat NaN as zero.
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.