pub trait Num:
Sized
+ Copy
+ AddAssign
+ SubAssign
+ Ord
+ Sub<Output = Self>
+ Neg<Output = Self>
+ Eq
+ Add<Output = Self> {
const ZERO: Self;
const ONE: Self;
const TWO: Self;
// Required methods
fn iter_range(range: Range<Self>) -> impl Iterator<Item = Self>;
fn as_u64(self) -> u64;
}Expand description
A helper trait for specifying generic numeric types.
Required Associated Constants§
Required Methods§
Sourcefn iter_range(range: Range<Self>) -> impl Iterator<Item = Self>
fn iter_range(range: Range<Self>) -> impl Iterator<Item = Self>
Iterate over a range. Workaround to std::ops::Range’s Iterator impl not being implementable for custom types.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".