pub(crate) trait DInt: Int {
    type H: HInt<D = Self> + Int;

    // Required methods
    fn lo(self) -> Self::H;
    fn hi(self) -> Self::H;
    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> + Int

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

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

Implementations on Foreign Types§

source§

impl DInt for i128

§

type H = i64

source§

fn lo(self) -> Self::H

source§

fn hi(self) -> Self::H

source§

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

source§

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

source§

impl DInt for i64

§

type H = i32

source§

fn lo(self) -> Self::H

source§

fn hi(self) -> Self::H

source§

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

source§

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

source§

impl DInt for i32

§

type H = i16

source§

fn lo(self) -> Self::H

source§

fn hi(self) -> Self::H

source§

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

source§

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

source§

impl DInt for u32

§

type H = u16

source§

fn lo(self) -> Self::H

source§

fn hi(self) -> Self::H

source§

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

source§

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

source§

impl DInt for u128

§

type H = u64

source§

fn lo(self) -> Self::H

source§

fn hi(self) -> Self::H

source§

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

source§

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

source§

impl DInt for u16

§

type H = u8

source§

fn lo(self) -> Self::H

source§

fn hi(self) -> Self::H

source§

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

source§

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

source§

impl DInt for i16

§

type H = i8

source§

fn lo(self) -> Self::H

source§

fn hi(self) -> Self::H

source§

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

source§

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

source§

impl DInt for u64

§

type H = u32

source§

fn lo(self) -> Self::H

source§

fn hi(self) -> Self::H

source§

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

source§

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

Implementors§