pub trait Num:
Sealed
+ Numeric<AsU8 = u8, AsU16 = u16, AsU32 = u32, AsU64 = u64, AsU128 = u128, AsUSize = usize, AsI8 = i8, AsI16 = i16, AsI32 = i32, AsI64 = i64, AsI128 = i128, AsISize = isize, AsF32 = f32, AsF64 = f64>
+ Debug
+ Display
+ Copy
+ Clone
+ PartialEq<Self>
+ PartialOrd<Self>
+ Add<Self, Output = Self>
+ Sub<Self, Output = Self>
+ Div<Self, Output = Self>
+ Mul<Self, Output = Self>
+ Rem<Self, Output = Self>
+ AddAssign<Self>
+ SubAssign<Self>
+ MulAssign<Self>
+ DivAssign<Self>
+ RemAssign<Self> {
const ZERO: Self;
const ONE: Self;
const TWO: Self;
const THREE: Self;
const FOUR: Self;
const MIN: Self;
const MAX: Self;
// Provided methods
fn min(a: Self, b: Self) -> Self { ... }
fn max(a: Self, b: Self) -> Self { ... }
fn min_max(a: Self, b: Self) -> (Self, Self) { ... }
fn clamp(x: Self, min: Self, max: Self) -> Self { ... }
}Expand description
A primitive number type.
Required Associated Constants§
const ZERO: Self
const ONE: Self
const TWO: Self
const THREE: Self
const FOUR: Self
const MIN: Self
const MAX: Self
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.