Skip to main content

Num

Trait Num 

Source
pub trait Num: Sized + Copy {
    const MAX: Self;
    const MIN: Self;

    // Provided method
    fn abs(&self) -> Self { ... }
}

Required Associated Constants§

Source

const MAX: Self

Source

const MIN: Self

Provided Methods§

Source

fn abs(&self) -> Self

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 i8

Source§

const MAX: Self = i8::MAX

Source§

const MIN: Self = i8::MIN

Source§

fn abs(&self) -> Self

Source§

impl Num for i16

Source§

const MAX: Self = i16::MAX

Source§

const MIN: Self = i16::MIN

Source§

fn abs(&self) -> Self

Source§

impl Num for i32

Source§

const MAX: Self = i32::MAX

Source§

const MIN: Self = i32::MIN

Source§

fn abs(&self) -> Self

Source§

impl Num for i64

Source§

const MAX: Self = i64::MAX

Source§

const MIN: Self = i64::MIN

Source§

fn abs(&self) -> Self

Source§

impl Num for i128

Source§

const MAX: Self = i128::MAX

Source§

const MIN: Self = i128::MIN

Source§

fn abs(&self) -> Self

Source§

impl Num for isize

Source§

const MAX: Self = isize::MAX

Source§

const MIN: Self = isize::MIN

Source§

fn abs(&self) -> Self

Source§

impl Num for u8

Source§

const MAX: Self = u8::MAX

Source§

const MIN: Self = u8::MIN

Source§

impl Num for u16

Source§

const MAX: Self = u16::MAX

Source§

const MIN: Self = u16::MIN

Source§

impl Num for u32

Source§

const MAX: Self = u32::MAX

Source§

const MIN: Self = u32::MIN

Source§

impl Num for u64

Source§

const MAX: Self = u64::MAX

Source§

const MIN: Self = u64::MIN

Source§

impl Num for u128

Source§

const MAX: Self = u128::MAX

Source§

const MIN: Self = u128::MIN

Source§

impl Num for usize

Source§

const MAX: Self = usize::MAX

Source§

const MIN: Self = usize::MIN

Implementors§