Trait nominals::UnsignedInteger
source · 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§
sourcefn as_usize(self) -> usize
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.