UnsignedBase

Trait UnsignedBase 

Source
pub trait UnsignedBase:
    From<u8>
    + Copy
    + TryInto<usize>
    + BitOrAssign
    + BitOr<Output = Self>
    + BitAnd<Output = Self>
    + Shl<i8, Output = Self>
    + Shr<i8, Output = Self>
    + Shl<usize, Output = Self>
    + Shr<usize, Output = Self>
    + ShrAssign
    + ShlAssign
    + BitOrAssign {
    const ZERO: Self;

    // Required methods
    fn leading_zeros(self) -> u32;
    fn as_usize(self) -> usize;
    fn as_u8(self) -> u8;
}

Required Associated Constants§

Source

const ZERO: Self

Required Methods§

Source

fn leading_zeros(self) -> u32

Source

fn as_usize(self) -> usize

Source

fn as_u8(self) -> u8

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 UnsignedBase for u8

Source§

const ZERO: Self = 0u8

Source§

fn leading_zeros(self) -> u32

Source§

fn as_usize(self) -> usize

Source§

fn as_u8(self) -> u8

Source§

impl UnsignedBase for u16

Source§

const ZERO: Self = 0u16

Source§

fn leading_zeros(self) -> u32

Source§

fn as_usize(self) -> usize

Source§

fn as_u8(self) -> u8

Source§

impl UnsignedBase for u32

Source§

const ZERO: Self = 0u32

Source§

fn leading_zeros(self) -> u32

Source§

fn as_usize(self) -> usize

Source§

fn as_u8(self) -> u8

Source§

impl UnsignedBase for u64

Source§

const ZERO: Self = 0u64

Source§

fn leading_zeros(self) -> u32

Source§

fn as_usize(self) -> usize

Source§

fn as_u8(self) -> u8

Source§

impl UnsignedBase for u128

Source§

const ZERO: Self = 0u128

Source§

fn leading_zeros(self) -> u32

Source§

fn as_usize(self) -> usize

Source§

fn as_u8(self) -> u8

Implementors§