pub trait UnderlyingInt:
Sized
+ Clone
+ Copy
+ Debug
+ Display
+ PartialEq
+ Eq
+ PartialOrd
+ Ord
+ Add<Output = Self>
+ Sub<Output = Self>
+ Div<Output = Self>
+ Rem<Output = Self>
+ Mul<Output = Self>
+ Shl<u32, Output = Self>
+ Shr<u32, Output = Self>
+ BitOr<Output = Self>
+ BitAnd<Output = Self>
+ BitXor<Output = Self>
+ AddAssign
+ SubAssign {
type Signed: Display;
const ZERO: Self;
const ONE: Self;
const TEN: Self;
const HUNDRED: Self;
const MAX_MATISSA: Self;
const MIN_UNDERINT: Self;
const BITS: u32;
const MAX_SCALE: u32;
const SCALE_BITS: u32 = _;
const META_BITS: u32 = _;
const MATISSA_BITS: u32 = _;
// Required methods
fn to_signed(self, sign: u8) -> Self::Signed;
fn from_signed(s: Self::Signed) -> (Self, u8);
fn as_u32(self) -> u32;
fn from_u32(n: u32) -> Self;
fn leading_zeros(self) -> u32;
fn mul_exp(self, iexp: u32) -> Self;
fn checked_mul_exp(self, iexp: u32) -> Option<Self>;
fn div_exp(self, iexp: u32) -> Self;
fn div_rem_exp(self, iexp: u32) -> (Self, Self);
fn mul_with_sum_scale(
self,
right: Self,
sum_scale: u32,
) -> Option<(Self, u32)>;
fn div_with_scales(
self,
d: Self,
s_scale: u32,
d_scale: u32,
) -> Option<(Self, u32)>;
}Expand description
Underlying integer type.
Required Associated Constants§
const ZERO: Self
const ONE: Self
const TEN: Self
const HUNDRED: Self
const MAX_MATISSA: Self
const MIN_UNDERINT: Self
const BITS: u32
const MAX_SCALE: u32
Provided Associated Constants§
Required Associated Types§
Required Methods§
fn to_signed(self, sign: u8) -> Self::Signed
fn from_signed(s: Self::Signed) -> (Self, u8)
fn as_u32(self) -> u32
fn from_u32(n: u32) -> Self
fn leading_zeros(self) -> u32
fn mul_exp(self, iexp: u32) -> Self
fn checked_mul_exp(self, iexp: u32) -> Option<Self>
fn div_exp(self, iexp: u32) -> Self
fn div_rem_exp(self, iexp: u32) -> (Self, Self)
fn mul_with_sum_scale(self, right: Self, sum_scale: u32) -> Option<(Self, u32)>
fn div_with_scales( self, d: Self, s_scale: u32, d_scale: u32, ) -> Option<(Self, u32)>
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.