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§
Sourcefn checked_add_signed(self, rhs: Self::Signed) -> Option<Self>
fn checked_add_signed(self, rhs: Self::Signed) -> Option<Self>
Sourcefn saturating_add_signed(self, rhs: Self::Signed) -> Self
fn saturating_add_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 overflowing_add_signed(self, rhs: Self::Signed) -> (Self, bool)
fn overflowing_add_signed(self, rhs: Self::Signed) -> (Self, bool)
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_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.