Trait Unsigned

Source
pub trait Unsigned: Integer + From<u8> {
    // Required methods
    fn checked_add_signed(self, rhs: Self::Signed) -> Option<Self>;
    fn saturating_add_signed(self, rhs: Self::Signed) -> Self;
    fn wrapping_add_signed(self, rhs: Self::Signed) -> Self;
    fn overflowing_add_signed(self, rhs: Self::Signed) -> (Self, bool);
    fn div_ceil(self, rhs: Self) -> Self;
    fn next_multiple_of(self, rhs: Self) -> Self;
    fn checked_next_multiple_of(self, rhs: Self) -> Option<Self>;
    fn is_power_of_two(self) -> bool;
    fn next_power_of_two(self) -> Self;
    fn checked_next_power_of_two(self) -> Option<Self>;
}

Required Methods§

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

Source§

fn checked_add_signed(self, rhs: Self::Signed) -> Option<Self>

Source§

fn saturating_add_signed(self, rhs: Self::Signed) -> Self

Source§

fn wrapping_add_signed(self, rhs: Self::Signed) -> Self

Source§

fn overflowing_add_signed(self, rhs: Self::Signed) -> (Self, bool)

Source§

fn div_ceil(self, rhs: Self) -> Self

Source§

fn next_multiple_of(self, rhs: Self) -> Self

Source§

fn checked_next_multiple_of(self, rhs: Self) -> Option<Self>

Source§

fn is_power_of_two(self) -> bool

Source§

fn next_power_of_two(self) -> Self

Source§

fn checked_next_power_of_two(self) -> Option<Self>

Source§

impl Unsigned for u16

Source§

fn checked_add_signed(self, rhs: Self::Signed) -> Option<Self>

Source§

fn saturating_add_signed(self, rhs: Self::Signed) -> Self

Source§

fn wrapping_add_signed(self, rhs: Self::Signed) -> Self

Source§

fn overflowing_add_signed(self, rhs: Self::Signed) -> (Self, bool)

Source§

fn div_ceil(self, rhs: Self) -> Self

Source§

fn next_multiple_of(self, rhs: Self) -> Self

Source§

fn checked_next_multiple_of(self, rhs: Self) -> Option<Self>

Source§

fn is_power_of_two(self) -> bool

Source§

fn next_power_of_two(self) -> Self

Source§

fn checked_next_power_of_two(self) -> Option<Self>

Source§

impl Unsigned for u32

Source§

fn checked_add_signed(self, rhs: Self::Signed) -> Option<Self>

Source§

fn saturating_add_signed(self, rhs: Self::Signed) -> Self

Source§

fn wrapping_add_signed(self, rhs: Self::Signed) -> Self

Source§

fn overflowing_add_signed(self, rhs: Self::Signed) -> (Self, bool)

Source§

fn div_ceil(self, rhs: Self) -> Self

Source§

fn next_multiple_of(self, rhs: Self) -> Self

Source§

fn checked_next_multiple_of(self, rhs: Self) -> Option<Self>

Source§

fn is_power_of_two(self) -> bool

Source§

fn next_power_of_two(self) -> Self

Source§

fn checked_next_power_of_two(self) -> Option<Self>

Source§

impl Unsigned for u64

Source§

fn checked_add_signed(self, rhs: Self::Signed) -> Option<Self>

Source§

fn saturating_add_signed(self, rhs: Self::Signed) -> Self

Source§

fn wrapping_add_signed(self, rhs: Self::Signed) -> Self

Source§

fn overflowing_add_signed(self, rhs: Self::Signed) -> (Self, bool)

Source§

fn div_ceil(self, rhs: Self) -> Self

Source§

fn next_multiple_of(self, rhs: Self) -> Self

Source§

fn checked_next_multiple_of(self, rhs: Self) -> Option<Self>

Source§

fn is_power_of_two(self) -> bool

Source§

fn next_power_of_two(self) -> Self

Source§

fn checked_next_power_of_two(self) -> Option<Self>

Source§

impl Unsigned for u128

Source§

fn checked_add_signed(self, rhs: Self::Signed) -> Option<Self>

Source§

fn saturating_add_signed(self, rhs: Self::Signed) -> Self

Source§

fn wrapping_add_signed(self, rhs: Self::Signed) -> Self

Source§

fn overflowing_add_signed(self, rhs: Self::Signed) -> (Self, bool)

Source§

fn div_ceil(self, rhs: Self) -> Self

Source§

fn next_multiple_of(self, rhs: Self) -> Self

Source§

fn checked_next_multiple_of(self, rhs: Self) -> Option<Self>

Source§

fn is_power_of_two(self) -> bool

Source§

fn next_power_of_two(self) -> Self

Source§

fn checked_next_power_of_two(self) -> Option<Self>

Source§

impl Unsigned for usize

Source§

fn checked_add_signed(self, rhs: Self::Signed) -> Option<Self>

Source§

fn saturating_add_signed(self, rhs: Self::Signed) -> Self

Source§

fn wrapping_add_signed(self, rhs: Self::Signed) -> Self

Source§

fn overflowing_add_signed(self, rhs: Self::Signed) -> (Self, bool)

Source§

fn div_ceil(self, rhs: Self) -> Self

Source§

fn next_multiple_of(self, rhs: Self) -> Self

Source§

fn checked_next_multiple_of(self, rhs: Self) -> Option<Self>

Source§

fn is_power_of_two(self) -> bool

Source§

fn next_power_of_two(self) -> Self

Source§

fn checked_next_power_of_two(self) -> Option<Self>

Implementors§