pub trait Primitive:
Num
+ NumCast
+ Copy
+ PartialEq
+ SampleUniform
+ Debug
+ Display
+ Default
+ PartialOrd {
const HALF: Self;
const MIN: Self;
const MAX: Self;
const ZERO: Self;
const ONE: Self;
const TWO: Self;
// Required methods
fn safe_add(self, rhs: Self) -> Self;
fn safe_sub(self, rhs: Self) -> Self;
fn safe_mul(self, rhs: Self) -> Self;
fn safe_div(self, rhs: Self) -> Self;
fn safe_mean(self, rhs: Self) -> Self;
fn is_equal(self, rhs: Self) -> bool;
// Provided method
fn extract<T: NumCast>(self) -> Option<T> { ... }
}Required Associated Constants§
const HALF: Self
const MIN: Self
const MAX: Self
const ZERO: Self
const ONE: Self
const TWO: Self
Required Methods§
fn safe_add(self, rhs: Self) -> Self
fn safe_sub(self, rhs: Self) -> Self
fn safe_mul(self, rhs: Self) -> Self
fn safe_div(self, rhs: Self) -> Self
fn safe_mean(self, rhs: Self) -> Self
fn is_equal(self, rhs: Self) -> bool
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".