pub trait UnsignedInteger: Ord + From<u8> + Sub<Output = Self> + Div<Output = Self> + Mul<Output = Self> + Rem<Output = Self> + SubAssign + DivAssign + MulAssign + RemAssign + Copy + Sized + IntegerDivision + TryFrom<usize> + TryInto<usize> {
    // Required methods
    fn is_zero(self) -> bool;
    fn as_usize(self) -> usize;
}
Expand description

An unsigned integer type.

Required Methods§

source

fn is_zero(self) -> bool

Returns true if self is 0.

source

fn as_usize(self) -> usize

Casts self as a usize.

This function should only be invoked when it is guaranteed the value is within the range of a usize. Otherwise, using fallible operations and returning an Error::OutOfBounds is preferred.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl UnsignedInteger for u8

source§

impl UnsignedInteger for u16

source§

impl UnsignedInteger for u32

source§

impl UnsignedInteger for u64

source§

impl UnsignedInteger for u128

source§

impl UnsignedInteger for usize

Implementors§