Trait MinInt

Source
pub trait MinInt:
    Copy
    + Debug
    + BitOr<Output = Self>
    + Not<Output = Self>
    + Shl<u32, Output = Self> {
    type OtherSign: MinInt;
    type Unsigned: MinInt;

    const SIGNED: bool;
    const BITS: u32;
    const ZERO: Self;
    const ONE: Self;
    const MIN: Self;
    const MAX: Self;
}
Expand description

Minimal integer implementations needed on all integer types, including wide integers.

Required Associated Constants§

Source

const SIGNED: bool

If Self is a signed integer

Source

const BITS: u32

The bitwidth of the int type

Source

const ZERO: Self

Source

const ONE: Self

Source

const MIN: Self

Source

const MAX: Self

Required Associated Types§

Source

type OtherSign: MinInt

Type with the same width but other signedness

Source

type Unsigned: MinInt

Unsigned version of 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 MinInt for i8

Source§

const BITS: u32 = 8u32

Source§

const SIGNED: bool = true

Source§

const ZERO: Self = 0i8

Source§

const ONE: Self = 1i8

Source§

const MIN: Self = -128i8

Source§

const MAX: Self = 127i8

Source§

type OtherSign = u8

Source§

type Unsigned = u8

Source§

impl MinInt for i16

Source§

const BITS: u32 = 16u32

Source§

const SIGNED: bool = true

Source§

const ZERO: Self = 0i16

Source§

const ONE: Self = 1i16

Source§

const MIN: Self = -32_768i16

Source§

const MAX: Self = 32_767i16

Source§

type OtherSign = u16

Source§

type Unsigned = u16

Source§

impl MinInt for i32

Source§

const BITS: u32 = 32u32

Source§

const SIGNED: bool = true

Source§

const ZERO: Self = 0i32

Source§

const ONE: Self = 1i32

Source§

const MIN: Self = -2_147_483_648i32

Source§

const MAX: Self = 2_147_483_647i32

Source§

type OtherSign = u32

Source§

type Unsigned = u32

Source§

impl MinInt for i64

Source§

const BITS: u32 = 64u32

Source§

const SIGNED: bool = true

Source§

const ZERO: Self = 0i64

Source§

const ONE: Self = 1i64

Source§

const MIN: Self = -9_223_372_036_854_775_808i64

Source§

const MAX: Self = 9_223_372_036_854_775_807i64

Source§

type OtherSign = u64

Source§

type Unsigned = u64

Source§

impl MinInt for i128

Source§

const BITS: u32 = 128u32

Source§

const SIGNED: bool = true

Source§

const ZERO: Self = 0i128

Source§

const ONE: Self = 1i128

Source§

const MIN: Self = -170_141_183_460_469_231_731_687_303_715_884_105_728i128

Source§

const MAX: Self = 170_141_183_460_469_231_731_687_303_715_884_105_727i128

Source§

type OtherSign = u128

Source§

type Unsigned = u128

Source§

impl MinInt for isize

Source§

const BITS: u32 = 64u32

Source§

const SIGNED: bool = true

Source§

const ZERO: Self = 0isize

Source§

const ONE: Self = 1isize

Source§

const MIN: Self = -9_223_372_036_854_775_808isize

Source§

const MAX: Self = 9_223_372_036_854_775_807isize

Source§

type OtherSign = usize

Source§

type Unsigned = usize

Source§

impl MinInt for u8

Source§

const BITS: u32 = 8u32

Source§

const SIGNED: bool = false

Source§

const ZERO: Self = 0u8

Source§

const ONE: Self = 1u8

Source§

const MIN: Self = 0u8

Source§

const MAX: Self = 255u8

Source§

type OtherSign = i8

Source§

type Unsigned = u8

Source§

impl MinInt for u16

Source§

const BITS: u32 = 16u32

Source§

const SIGNED: bool = false

Source§

const ZERO: Self = 0u16

Source§

const ONE: Self = 1u16

Source§

const MIN: Self = 0u16

Source§

const MAX: Self = 65_535u16

Source§

type OtherSign = i16

Source§

type Unsigned = u16

Source§

impl MinInt for u32

Source§

const BITS: u32 = 32u32

Source§

const SIGNED: bool = false

Source§

const ZERO: Self = 0u32

Source§

const ONE: Self = 1u32

Source§

const MIN: Self = 0u32

Source§

const MAX: Self = 4_294_967_295u32

Source§

type OtherSign = i32

Source§

type Unsigned = u32

Source§

impl MinInt for u64

Source§

const BITS: u32 = 64u32

Source§

const SIGNED: bool = false

Source§

const ZERO: Self = 0u64

Source§

const ONE: Self = 1u64

Source§

const MIN: Self = 0u64

Source§

const MAX: Self = 18_446_744_073_709_551_615u64

Source§

type OtherSign = i64

Source§

type Unsigned = u64

Source§

impl MinInt for u128

Source§

const BITS: u32 = 128u32

Source§

const SIGNED: bool = false

Source§

const ZERO: Self = 0u128

Source§

const ONE: Self = 1u128

Source§

const MIN: Self = 0u128

Source§

const MAX: Self = 340_282_366_920_938_463_463_374_607_431_768_211_455u128

Source§

type OtherSign = i128

Source§

type Unsigned = u128

Source§

impl MinInt for usize

Source§

const BITS: u32 = 64u32

Source§

const SIGNED: bool = false

Source§

const ZERO: Self = 0usize

Source§

const ONE: Self = 1usize

Source§

const MIN: Self = 0usize

Source§

const MAX: Self = 18_446_744_073_709_551_615usize

Source§

type OtherSign = isize

Source§

type Unsigned = usize

Implementors§

Source§

impl MinInt for i256

Source§

const SIGNED: bool = false

Source§

const BITS: u32 = 256u32

Source§

const ZERO: Self

Source§

const ONE: Self

Source§

const MIN: Self

Source§

const MAX: Self

Source§

type OtherSign = u256

Source§

type Unsigned = u256

Source§

impl MinInt for u256

Source§

const SIGNED: bool = false

Source§

const BITS: u32 = 256u32

Source§

const ZERO: Self

Source§

const ONE: Self

Source§

const MIN: Self

Source§

const MAX: Self

Source§

type OtherSign = i256

Source§

type Unsigned = u256