Trait UnsignedInt

Source
pub trait UnsignedInt:
    PartialEq
    + PartialOrd
    + Eq
    + Ord
    + Copy {
    const WIDTH: usize;
    const MIN_BOUND: Self;
    const MAX_BOUND: Self;

    // Required methods
    fn count_ones(self) -> u32;
    fn count_zeros(self) -> u32;
    fn succ(&self) -> Self;
    fn pred(&self) -> Self;
}

Required Associated Constants§

Source

const WIDTH: usize

Source

const MIN_BOUND: Self

Source

const MAX_BOUND: Self

Required Methods§

Source

fn count_ones(self) -> u32

Source

fn count_zeros(self) -> u32

Source

fn succ(&self) -> Self

Source

fn pred(&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 UnsignedInt for u8

Source§

const WIDTH: usize = 8usize

Source§

const MIN_BOUND: Self = 0u8

Source§

const MAX_BOUND: Self = 255u8

Source§

fn count_ones(self) -> u32

Source§

fn count_zeros(self) -> u32

Source§

fn succ(&self) -> Self

Source§

fn pred(&self) -> Self

Source§

impl UnsignedInt for u16

Source§

const WIDTH: usize = 16usize

Source§

const MIN_BOUND: Self = 0u16

Source§

const MAX_BOUND: Self = 65_535u16

Source§

fn count_ones(self) -> u32

Source§

fn count_zeros(self) -> u32

Source§

fn succ(&self) -> Self

Source§

fn pred(&self) -> Self

Source§

impl UnsignedInt for u32

Source§

const WIDTH: usize = 32usize

Source§

const MIN_BOUND: Self = 0u32

Source§

const MAX_BOUND: Self = 4_294_967_295u32

Source§

fn count_ones(self) -> u32

Source§

fn count_zeros(self) -> u32

Source§

fn succ(&self) -> Self

Source§

fn pred(&self) -> Self

Source§

impl UnsignedInt for u64

Source§

const WIDTH: usize = 64usize

Source§

const MIN_BOUND: Self = 0u64

Source§

const MAX_BOUND: Self = 18_446_744_073_709_551_615u64

Source§

fn count_ones(self) -> u32

Source§

fn count_zeros(self) -> u32

Source§

fn succ(&self) -> Self

Source§

fn pred(&self) -> Self

Source§

impl UnsignedInt for u128

Source§

const WIDTH: usize = 128usize

Source§

const MIN_BOUND: Self = 0u128

Source§

const MAX_BOUND: Self = 340_282_366_920_938_463_463_374_607_431_768_211_455u128

Source§

fn count_ones(self) -> u32

Source§

fn count_zeros(self) -> u32

Source§

fn succ(&self) -> Self

Source§

fn pred(&self) -> Self

Source§

impl UnsignedInt for usize

Source§

const WIDTH: usize = 32usize

Source§

const MIN_BOUND: Self = 0usize

Source§

const MAX_BOUND: Self = 4_294_967_295usize

Source§

fn count_ones(self) -> u32

Source§

fn count_zeros(self) -> u32

Source§

fn succ(&self) -> Self

Source§

fn pred(&self) -> Self

Implementors§