pub trait Unsigned: Sized + Copy + Shr<u32, Output = Self> + Shl<u32, Output = Self> + BitXor<Self, Output = Self> + BitAnd<Self, Output = Self> + PartialOrd<Self> + Ord {
    type Signed: Signed;

    const ONE: Self;

    fn signed(self) -> Self::Signed;
    fn from_byte(byte: u8) -> Self;
    fn as_byte(self) -> u8;
    fn is_zero(self) -> bool;
    fn checked_shr(self, value: u32) -> Option<Self>;
    fn checked_shl(self, value: u32) -> Option<Self>;
    fn checked_add(self, value: Self) -> Option<Self>;
}
Expand description

Trait that encodes common behaviors of unsigned numbers.

Required Associated Types

The signed representation of this unsigned number.

Required Associated Constants

The number 1 as represented by the current unsigned number.

Required Methods

Coerce this number bitwise into its signed representation.

Construct from the first byte.

Coerce into the lowest 8-bits as a byte.

Test if value is zero.

Perform a shift-right operation.

Perform a shift-left operation.

Perform a checked addition.

Implementations on Foreign Types

Implementors