Num

Trait Num 

Source
pub trait Num:
    'static
    + Eq
    + Copy
    + Clone
    + Debug
    + Hash
    + Bounded
    + Ord {
    type Range: Iterator<Item = Self>;

    // Required methods
    fn range(a: usize, b: usize) -> Self::Range;
    fn to_usize(self) -> usize;
    fn from_usize(v: usize) -> Self;
    fn is_valid(v: usize) -> bool;
}

Required Associated Types§

Source

type Range: Iterator<Item = Self>

Required Methods§

Source

fn range(a: usize, b: usize) -> Self::Range

Source

fn to_usize(self) -> usize

Source

fn from_usize(v: usize) -> Self

Source

fn is_valid(v: usize) -> bool

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.

Implementations on Foreign Types§

Source§

impl Num for u8

Source§

impl Num for u16

Source§

impl Num for u32

Source§

impl Num for u64

Source§

impl Num for usize

Implementors§