Trait BasicNum

Source
pub trait BasicNum {
    const MIN_VALUE: Self;
    const MAX_VALUE: Self;

    // Required methods
    fn dec(&self) -> Self;
    fn inc(&self) -> Self;
}
Expand description

Basic operations (increase decrease) for numbers

Required Associated Constants§

Source

const MIN_VALUE: Self

Source

const MAX_VALUE: Self

Required Methods§

Source

fn dec(&self) -> Self

Source

fn inc(&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 BasicNum for i8

Source§

const MIN_VALUE: Self = -128i8

Source§

const MAX_VALUE: Self = 127i8

Source§

fn dec(&self) -> Self

Source§

fn inc(&self) -> Self

Source§

impl BasicNum for i16

Source§

const MIN_VALUE: Self = -32_768i16

Source§

const MAX_VALUE: Self = 32_767i16

Source§

fn dec(&self) -> Self

Source§

fn inc(&self) -> Self

Source§

impl BasicNum for i32

Source§

const MIN_VALUE: Self = -2_147_483_648i32

Source§

const MAX_VALUE: Self = 2_147_483_647i32

Source§

fn dec(&self) -> Self

Source§

fn inc(&self) -> Self

Source§

impl BasicNum for i64

Source§

const MIN_VALUE: Self = -9_223_372_036_854_775_808i64

Source§

const MAX_VALUE: Self = 9_223_372_036_854_775_807i64

Source§

fn dec(&self) -> Self

Source§

fn inc(&self) -> Self

Source§

impl BasicNum for i128

Source§

const MIN_VALUE: Self = -170_141_183_460_469_231_731_687_303_715_884_105_728i128

Source§

const MAX_VALUE: Self = 170_141_183_460_469_231_731_687_303_715_884_105_727i128

Source§

fn dec(&self) -> Self

Source§

fn inc(&self) -> Self

Source§

impl BasicNum for isize

Source§

const MIN_VALUE: Self = -9_223_372_036_854_775_808isize

Source§

const MAX_VALUE: Self = 9_223_372_036_854_775_807isize

Source§

fn dec(&self) -> Self

Source§

fn inc(&self) -> Self

Source§

impl BasicNum for u8

Source§

const MIN_VALUE: Self = 0u8

Source§

const MAX_VALUE: Self = 255u8

Source§

fn dec(&self) -> Self

Source§

fn inc(&self) -> Self

Source§

impl BasicNum for u16

Source§

const MIN_VALUE: Self = 0u16

Source§

const MAX_VALUE: Self = 65_535u16

Source§

fn dec(&self) -> Self

Source§

fn inc(&self) -> Self

Source§

impl BasicNum for u32

Source§

const MIN_VALUE: Self = 0u32

Source§

const MAX_VALUE: Self = 4_294_967_295u32

Source§

fn dec(&self) -> Self

Source§

fn inc(&self) -> Self

Source§

impl BasicNum for u64

Source§

const MIN_VALUE: Self = 0u64

Source§

const MAX_VALUE: Self = 18_446_744_073_709_551_615u64

Source§

fn dec(&self) -> Self

Source§

fn inc(&self) -> Self

Source§

impl BasicNum for u128

Source§

const MIN_VALUE: Self = 0u128

Source§

const MAX_VALUE: Self = 340_282_366_920_938_463_463_374_607_431_768_211_455u128

Source§

fn dec(&self) -> Self

Source§

fn inc(&self) -> Self

Source§

impl BasicNum for usize

Source§

const MIN_VALUE: Self = 0usize

Source§

const MAX_VALUE: Self = 18_446_744_073_709_551_615usize

Source§

fn dec(&self) -> Self

Source§

fn inc(&self) -> Self

Implementors§