pub trait HInt: Int {
type D: DInt<H = Self> + MinInt;
// Required methods
fn widen(self) -> Self::D;
fn zero_widen(self) -> Self::D;
fn widen_hi(self) -> Self::D;
fn zero_widen_mul(self, rhs: Self) -> Self::D;
fn widen_mul(self, rhs: Self) -> Self::D;
}
Expand description
Trait for integers half the bit width of another integer. This is implemented for all
primitives except for u128
, because it there is not a larger primitive.
Required Associated Types§
Required Methods§
Sourcefn widen(self) -> Self::D
fn widen(self) -> Self::D
Widens (using default extension) the integer to have double bit width
Sourcefn zero_widen(self) -> Self::D
fn zero_widen(self) -> Self::D
Widens (zero extension only) the integer to have double bit width. This is needed to get
around problems with associated type bounds (such as Int<Othersign: DInt>
) being unstable
Sourcefn widen_hi(self) -> Self::D
fn widen_hi(self) -> Self::D
Widens the integer to have double bit width and shifts the integer into the higher bits
Sourcefn zero_widen_mul(self, rhs: Self) -> Self::D
fn zero_widen_mul(self, rhs: Self) -> Self::D
Widening multiplication with zero widening. This cannot overflow.
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.