Unsigned

Trait Unsigned 

Source
pub trait Unsigned: Integer<Unsigned = Self> + From<u8> {
Show 23 methods // Required methods fn cast_signed(self) -> Self::Signed; fn checked_add_signed(self, rhs: Self::Signed) -> Option<Self>; fn strict_add_signed(self, rhs: Self::Signed) -> Self; fn checked_sub_signed(self, rhs: Self::Signed) -> Option<Self>; fn strict_sub_signed(self, rhs: Self::Signed) -> Self; fn checked_signed_diff(self, rhs: Self) -> Option<Self::Signed>; fn saturating_add_signed(self, rhs: Self::Signed) -> Self; fn saturating_sub_signed(self, rhs: Self::Signed) -> Self; fn wrapping_add_signed(self, rhs: Self::Signed) -> Self; fn wrapping_sub_signed(self, rhs: Self::Signed) -> Self; fn carrying_add(self, rhs: Self, carry: bool) -> (Self, bool); fn overflowing_add_signed(self, rhs: Self::Signed) -> (Self, bool); fn borrowing_sub(self, rhs: Self, borrow: bool) -> (Self, bool); fn overflowing_sub_signed(self, rhs: Self::Signed) -> (Self, bool); fn carrying_mul(self, rhs: Self, carry: Self) -> (Self, Self); fn carrying_mul_add(self, rhs: Self, carry: Self, add: Self) -> (Self, Self); 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_multiple_of(self, rhs: Self) -> bool; 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§

Source

fn cast_signed(self) -> Self::Signed

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

fn carrying_add(self, rhs: Self, carry: bool) -> (Self, bool)

Source

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

Source

fn borrowing_sub(self, rhs: Self, borrow: bool) -> (Self, bool)

Source

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

Source

fn carrying_mul(self, rhs: Self, carry: Self) -> (Self, Self)

Source

fn carrying_mul_add(self, rhs: Self, carry: Self, add: Self) -> (Self, Self)

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_multiple_of(self, rhs: Self) -> bool

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>

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 cast_signed(self) -> Self::Signed

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

fn carrying_add(self, rhs: Self, carry: bool) -> (Self, bool)

Source§

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

Source§

fn borrowing_sub(self, rhs: Self, borrow: bool) -> (Self, bool)

Source§

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

Source§

fn carrying_mul(self, rhs: Self, carry: Self) -> (Self, Self)

Source§

fn carrying_mul_add(self, rhs: Self, carry: Self, add: Self) -> (Self, Self)

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_multiple_of(self, rhs: Self) -> bool

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 cast_signed(self) -> Self::Signed

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

fn carrying_add(self, rhs: Self, carry: bool) -> (Self, bool)

Source§

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

Source§

fn borrowing_sub(self, rhs: Self, borrow: bool) -> (Self, bool)

Source§

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

Source§

fn carrying_mul(self, rhs: Self, carry: Self) -> (Self, Self)

Source§

fn carrying_mul_add(self, rhs: Self, carry: Self, add: Self) -> (Self, Self)

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_multiple_of(self, rhs: Self) -> bool

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 cast_signed(self) -> Self::Signed

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

fn carrying_add(self, rhs: Self, carry: bool) -> (Self, bool)

Source§

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

Source§

fn borrowing_sub(self, rhs: Self, borrow: bool) -> (Self, bool)

Source§

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

Source§

fn carrying_mul(self, rhs: Self, carry: Self) -> (Self, Self)

Source§

fn carrying_mul_add(self, rhs: Self, carry: Self, add: Self) -> (Self, Self)

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_multiple_of(self, rhs: Self) -> bool

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 cast_signed(self) -> Self::Signed

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

fn carrying_add(self, rhs: Self, carry: bool) -> (Self, bool)

Source§

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

Source§

fn borrowing_sub(self, rhs: Self, borrow: bool) -> (Self, bool)

Source§

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

Source§

fn carrying_mul(self, rhs: Self, carry: Self) -> (Self, Self)

Source§

fn carrying_mul_add(self, rhs: Self, carry: Self, add: Self) -> (Self, Self)

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_multiple_of(self, rhs: Self) -> bool

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 cast_signed(self) -> Self::Signed

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

fn carrying_add(self, rhs: Self, carry: bool) -> (Self, bool)

Source§

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

Source§

fn borrowing_sub(self, rhs: Self, borrow: bool) -> (Self, bool)

Source§

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

Source§

fn carrying_mul(self, rhs: Self, carry: Self) -> (Self, Self)

Source§

fn carrying_mul_add(self, rhs: Self, carry: Self, add: Self) -> (Self, Self)

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_multiple_of(self, rhs: Self) -> bool

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 cast_signed(self) -> Self::Signed

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

fn carrying_add(self, rhs: Self, carry: bool) -> (Self, bool)

Source§

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

Source§

fn borrowing_sub(self, rhs: Self, borrow: bool) -> (Self, bool)

Source§

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

Source§

fn carrying_mul(self, rhs: Self, carry: Self) -> (Self, Self)

Source§

fn carrying_mul_add(self, rhs: Self, carry: Self, add: Self) -> (Self, Self)

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_multiple_of(self, rhs: Self) -> bool

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§