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§
Sourcefn cast_signed(self) -> Self::Signed
fn cast_signed(self) -> Self::Signed
See u32::cast_signed.
Sourcefn checked_add_signed(self, rhs: Self::Signed) -> Option<Self>
fn checked_add_signed(self, rhs: Self::Signed) -> Option<Self>
Sourcefn strict_add_signed(self, rhs: Self::Signed) -> Self
fn strict_add_signed(self, rhs: Self::Signed) -> Self
Sourcefn checked_sub_signed(self, rhs: Self::Signed) -> Option<Self>
fn checked_sub_signed(self, rhs: Self::Signed) -> Option<Self>
Sourcefn strict_sub_signed(self, rhs: Self::Signed) -> Self
fn strict_sub_signed(self, rhs: Self::Signed) -> Self
Sourcefn checked_signed_diff(self, rhs: Self) -> Option<Self::Signed>
fn checked_signed_diff(self, rhs: Self) -> Option<Self::Signed>
Sourcefn saturating_add_signed(self, rhs: Self::Signed) -> Self
fn saturating_add_signed(self, rhs: Self::Signed) -> Self
Sourcefn saturating_sub_signed(self, rhs: Self::Signed) -> Self
fn saturating_sub_signed(self, rhs: Self::Signed) -> Self
Sourcefn wrapping_add_signed(self, rhs: Self::Signed) -> Self
fn wrapping_add_signed(self, rhs: Self::Signed) -> Self
Sourcefn wrapping_sub_signed(self, rhs: Self::Signed) -> Self
fn wrapping_sub_signed(self, rhs: Self::Signed) -> Self
Sourcefn carrying_add(self, rhs: Self, carry: bool) -> (Self, bool)
fn carrying_add(self, rhs: Self, carry: bool) -> (Self, bool)
See u32::carrying_add.
Sourcefn overflowing_add_signed(self, rhs: Self::Signed) -> (Self, bool)
fn overflowing_add_signed(self, rhs: Self::Signed) -> (Self, bool)
Sourcefn borrowing_sub(self, rhs: Self, borrow: bool) -> (Self, bool)
fn borrowing_sub(self, rhs: Self, borrow: bool) -> (Self, bool)
See u32::borrowing_sub.
Sourcefn overflowing_sub_signed(self, rhs: Self::Signed) -> (Self, bool)
fn overflowing_sub_signed(self, rhs: Self::Signed) -> (Self, bool)
Sourcefn carrying_mul(self, rhs: Self, carry: Self) -> (Self, Self)
fn carrying_mul(self, rhs: Self, carry: Self) -> (Self, Self)
See u32::carrying_mul.
Sourcefn carrying_mul_add(self, rhs: Self, carry: Self, add: Self) -> (Self, Self)
fn carrying_mul_add(self, rhs: Self, carry: Self, add: Self) -> (Self, Self)
Sourcefn div_ceil(self, rhs: Self) -> Self
fn div_ceil(self, rhs: Self) -> Self
See u32::div_ceil.
Sourcefn next_multiple_of(self, rhs: Self) -> Self
fn next_multiple_of(self, rhs: Self) -> Self
Sourcefn checked_next_multiple_of(self, rhs: Self) -> Option<Self>
fn checked_next_multiple_of(self, rhs: Self) -> Option<Self>
Sourcefn is_multiple_of(self, rhs: Self) -> bool
fn is_multiple_of(self, rhs: Self) -> bool
See u32::is_multiple_of.
Sourcefn is_power_of_two(self) -> bool
fn is_power_of_two(self) -> bool
See u32::is_power_of_two.
Sourcefn next_power_of_two(self) -> Self
fn next_power_of_two(self) -> Self
Sourcefn checked_next_power_of_two(self) -> Option<Self>
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.