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§
Sourcetype Wide: Copy + From<Self> + TryInto<Self> + NumOps + Unsigned
type Wide: Copy + From<Self> + TryInto<Self> + NumOps + Unsigned
Unsigned double-width extension type.
Sourcetype SignedWide: Copy + From<Self> + TryInto<Self> + NumOps + Zero + One + Signed + PartialOrd
type SignedWide: Copy + From<Self> + TryInto<Self> + NumOps + Zero + One + Signed + PartialOrd
Signed double-width extension type.
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.