Skip to main content

Number

Trait Number 

Source
pub trait Number {
    const ZERO: Self;
    const MIN: Self;
    const MAX: Self;
}
Expand description

Similar to num_traits, but we use need to be able to customize values

Required Associated Constants§

Source

const ZERO: Self

Zero value of this type

Source

const MIN: Self

Smallest finite number this type can represent

Source

const MAX: Self

Largest finite number this type can represent

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 Number for f32

Source§

const ZERO: f32 = 0.0

Source§

const MIN: f32 = f32::MIN

Source§

const MAX: f32 = f32::MAX

Source§

impl Number for f64

Source§

const ZERO: f64 = 0.0

Source§

const MIN: f64 = f64::MIN

Source§

const MAX: f64 = f64::MAX

Source§

impl Number for i8

Source§

const ZERO: i8 = 0

Source§

const MIN: i8 = i8::MIN

Source§

const MAX: i8 = i8::MAX

Source§

impl Number for i16

Source§

const ZERO: i16 = 0

Source§

const MIN: i16 = i16::MIN

Source§

const MAX: i16 = i16::MAX

Source§

impl Number for i32

Source§

const ZERO: i32 = 0

Source§

const MIN: i32 = i32::MIN

Source§

const MAX: i32 = i32::MAX

Source§

impl Number for i64

Source§

impl Number for u8

Source§

const ZERO: u8 = 0

Source§

const MIN: u8 = u8::MIN

Source§

const MAX: u8 = u8::MAX

Source§

impl Number for u16

Source§

const ZERO: u16 = 0

Source§

const MIN: u16 = u16::MIN

Source§

const MAX: u16 = u16::MAX

Source§

impl Number for u32

Source§

const ZERO: u32 = 0

Source§

const MIN: u32 = u32::MIN

Source§

const MAX: u32 = u32::MAX

Source§

impl Number for u64

Source§

const ZERO: u64 = 0

Source§

const MIN: u64 = 0

Source§

const MAX: u64

Implementors§