pub trait DoubleWidth: Sized + Unsigned {
    type Wide: Copy + From<Self> + TryInto<Self> + NumOps + Unsigned;
    type SignedWide: Copy + From<Self> + TryInto<Self> + NumOps + Zero + One + Signed + PartialOrd;
}
Expand description

Encapsulates extension of an unsigned integer type into signed and unsigned double-width types. This allows performing certain operations (e.g., multiplication) without a possibility of integer overflow.

Required Associated Types§

source

type Wide: Copy + From<Self> + TryInto<Self> + NumOps + Unsigned

Unsigned double-width extension type.

source

type SignedWide: Copy + From<Self> + TryInto<Self> + NumOps + Zero + One + Signed + PartialOrd

Signed double-width extension type.

Implementations on Foreign Types§

source§

impl DoubleWidth for u64

source§

impl DoubleWidth for u8

§

type Wide = u16

§

type SignedWide = i16

source§

impl DoubleWidth for u32

§

type Wide = u64

§

type SignedWide = i64

source§

impl DoubleWidth for u16

§

type Wide = u32

§

type SignedWide = i32

Implementors§