Skip to main content

Integer

Trait Integer 

Source
pub trait Integer:
    Sized
    + Clone
    + Copy
    + Debug
    + Shr<u32, Output = Self>
    + Shl<u32, Output = Self>
    + BitAnd<Output = Self>
    + BitOr<Output = Self>
    + PartialEq
    + CastInto<i16> {
    const ZERO: Self;
    const ONE: Self;
}
🔬This is a nightly-only experimental API. (dec2flt)
Expand description

Collection of traits that allow us to be generic over integer size.

Required Associated Constants§

Source

const ZERO: Self

🔬This is a nightly-only experimental API. (dec2flt)
Source

const ONE: Self

🔬This is a nightly-only experimental API. (dec2flt)

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.

Implementors§

Source§

impl Integer for u16

Source§

const ZERO: Self = 0

Source§

const ONE: Self = 1

Source§

impl Integer for u32

Source§

const ZERO: Self = 0

Source§

const ONE: Self = 1

Source§

impl Integer for u64

Source§

const ZERO: Self = 0

Source§

const ONE: Self = 1