pub trait DInt: MinInt {
    type H: HInt<D = Self>;

    // Required methods
    fn lo(self) -> Self::H;
    fn hi(self) -> Self::H;

    // Provided methods
    fn lo_hi(self) -> (Self::H, Self::H) { ... }
    fn from_lo_hi(lo: Self::H, hi: Self::H) -> Self { ... }
}
Expand description

Trait for integers twice the bit width of another integer. This is implemented for all primitives except for u8, because there is not a smaller primitive.

Required Associated Types§

Source

type H: HInt<D = Self>

Integer that is half the bit width of the integer this trait is implemented for

Required Methods§

Source

fn lo(self) -> Self::H

Returns the low half of self

Source

fn hi(self) -> Self::H

Returns the high half of self

Provided Methods§

Source

fn lo_hi(self) -> (Self::H, Self::H)

Returns the low and high halves of self as a tuple

Source

fn from_lo_hi(lo: Self::H, hi: Self::H) -> Self

Constructs an integer using lower and higher half parts

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.

Implementors§