Skip to main content

Unsigned

Trait Unsigned 

Source
pub unsafe trait Unsigned
where Self: Integral<Unsigned = Self, Signed: Integral<Unsigned = Self>>,
{
Show 22 methods // Required methods fn borrowing_sub(self, rhs: Self, borrow: bool) -> (Self, bool); fn carrying_add(self, rhs: Self, carry: bool) -> (Self, bool); fn carrying_mul(self, rhs: Self, carry: Self) -> (Self::Unsigned, Self); fn carrying_mul_add( self, mul: Self, add: Self, carry: Self, ) -> (Self::Unsigned, Self); fn cast_signed(self) -> Self::Signed; fn checked_add_signed(self, rhs: Self::Signed) -> Option<Self>; fn checked_next_multiple_of(self, rhs: Self) -> Option<Self>; fn checked_next_power_of_two(self) -> Option<Self>; fn checked_signed_diff(self, rhs: Self) -> Option<Self::Signed>; fn checked_sub_signed(self, rhs: Self::Signed) -> Option<Self>; fn div_ceil(self, rhs: Self) -> Self; fn is_power_of_two(self) -> bool; fn next_multiple_of(self, rhs: Self) -> Self; fn next_power_of_two(self) -> Self; fn overflowing_add_signed(self, rhs: Self::Signed) -> (Self, bool); fn overflowing_sub_signed(self, rhs: Self::Signed) -> (Self, bool); fn saturating_add_signed(self, rhs: Self::Signed) -> Self; fn saturating_sub_signed(self, rhs: Self::Signed) -> Self; fn strict_add_signed(self, rhs: Self::Signed) -> Self; fn strict_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;
}
Expand description

Denotes an unsigned, integral type.

These include:

§Safety

All items must behave to the same specifications as the standard items.

Required Methods§

Source

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

Source

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

Source

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

Source

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

Source

fn cast_signed(self) -> Self::Signed

Source

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

Source

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

Source

fn checked_next_power_of_two(self) -> Option<Self>

Source

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

Source

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

Source

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

Source

fn is_power_of_two(self) -> bool

Source

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

Source

fn next_power_of_two(self) -> Self

Source

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

Source

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

Source

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

Source

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

Source

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

Source

fn strict_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

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

Source§

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

Source§

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

Source§

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

Source§

fn cast_signed(self) -> <Self as Integral>::Signed

Source§

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

Source§

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

Source§

fn checked_next_power_of_two(self) -> Option<Self>

Source§

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

Source§

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

Source§

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

Source§

fn is_power_of_two(self) -> bool

Source§

fn next_power_of_two(self) -> Self

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

impl Unsigned for u16

Source§

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

Source§

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

Source§

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

Source§

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

Source§

fn cast_signed(self) -> <Self as Integral>::Signed

Source§

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

Source§

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

Source§

fn checked_next_power_of_two(self) -> Option<Self>

Source§

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

Source§

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

Source§

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

Source§

fn is_power_of_two(self) -> bool

Source§

fn next_power_of_two(self) -> Self

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

impl Unsigned for u32

Source§

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

Source§

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

Source§

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

Source§

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

Source§

fn cast_signed(self) -> <Self as Integral>::Signed

Source§

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

Source§

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

Source§

fn checked_next_power_of_two(self) -> Option<Self>

Source§

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

Source§

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

Source§

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

Source§

fn is_power_of_two(self) -> bool

Source§

fn next_power_of_two(self) -> Self

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

impl Unsigned for u64

Source§

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

Source§

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

Source§

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

Source§

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

Source§

fn cast_signed(self) -> <Self as Integral>::Signed

Source§

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

Source§

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

Source§

fn checked_next_power_of_two(self) -> Option<Self>

Source§

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

Source§

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

Source§

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

Source§

fn is_power_of_two(self) -> bool

Source§

fn next_power_of_two(self) -> Self

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

impl Unsigned for u128

Source§

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

Source§

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

Source§

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

Source§

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

Source§

fn cast_signed(self) -> <Self as Integral>::Signed

Source§

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

Source§

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

Source§

fn checked_next_power_of_two(self) -> Option<Self>

Source§

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

Source§

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

Source§

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

Source§

fn is_power_of_two(self) -> bool

Source§

fn next_power_of_two(self) -> Self

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

impl Unsigned for usize

Source§

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

Source§

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

Source§

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

Source§

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

Source§

fn cast_signed(self) -> <Self as Integral>::Signed

Source§

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

Source§

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

Source§

fn checked_next_power_of_two(self) -> Option<Self>

Source§

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

Source§

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

Source§

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

Source§

fn is_power_of_two(self) -> bool

Source§

fn next_power_of_two(self) -> Self

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Implementors§