pub trait IntTypes:
PrimInt
+ NumCast
+ ConstZero
+ ConstOne
+ WrappingAdd
+ WrappingNeg
+ Copy {
type SignedType: PrimInt + Signed + ConstZero + ConstOne + Copy + NumCast;
type UnsignedType: PrimInt + Unsigned + ConstZero + ConstOne + Copy + NumCast + WrappingNeg;
type OtherSignType: PrimInt + ConstOne + ConstZero + Copy + NumCast;
// Required method
fn abs_as_unsigned(a: Self) -> Self::UnsignedType;
}Expand description
Primitive integer types
Mappings to associated signed and unsigned types with the same bit width.
Required Associated Types§
type SignedType: PrimInt + Signed + ConstZero + ConstOne + Copy + NumCast
type UnsignedType: PrimInt + Unsigned + ConstZero + ConstOne + Copy + NumCast + WrappingNeg
type OtherSignType: PrimInt + ConstOne + ConstZero + Copy + NumCast
Required Methods§
Sourcefn abs_as_unsigned(a: Self) -> Self::UnsignedType
fn abs_as_unsigned(a: Self) -> Self::UnsignedType
abs() function which returns a corresponding unsigned type
For unsigned input types, just return the same value. For signed types, return the unsigned type of the same bit width.
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.