pub trait ChooseMinimallyRepresentableUInt: SealedTrait {
type Output: AddAssign + Add<Self::Output, Output = Self::Output> + PartialOrd + Debug + Display + Copy + Eq + Ord + Clone + Hash + Default;
type AtomicOutput;
const ZERO: Self::Output;
const ONE: Self::Output;
// Required method
fn cast_unsigned_to_self_type<T: Unsigned>(_: SealedToken) -> Self::Output;
}Expand description
A trait for types that can choose the minimally representable unsigned integer.
Required Associated Constants§
Required Associated Types§
Sourcetype Output: AddAssign + Add<Self::Output, Output = Self::Output> + PartialOrd + Debug + Display + Copy + Eq + Ord + Clone + Hash + Default
type Output: AddAssign + Add<Self::Output, Output = Self::Output> + PartialOrd + Debug + Display + Copy + Eq + Ord + Clone + Hash + Default
The Rust’s primitive unsigned integer type that is minimally representable of the unsigned integer represented at the type level by Self.
e.g. If Self is typenum::consts::U69, then Self::Output is u8.
Sourcetype AtomicOutput
type AtomicOutput
Currently, a placeholder for future feature of this crate. Safe to put a placeholder here because this is a ‘Sealed’ trait.
Required Methods§
Sourcefn cast_unsigned_to_self_type<T: Unsigned>(_: SealedToken) -> Self::Output
fn cast_unsigned_to_self_type<T: Unsigned>(_: SealedToken) -> Self::Output
A convenient method to convert the unsigned integer represented at the type level by Self to a value of type Self::Output.
e.g. converting from typenum::consts::U69 to 69_u8.
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.