Trait Primitive
pub trait Primitive: Clone + Copy + Eq + PartialEq + PartialOrd + Ord + Debug + Display
A trait for making x as int_type usable in a generic context.
All of these methods require callers to ensure the cast is correct.
However, when debug_assertions is enabled, the casts will result in
a panic if they are incorrect.
Because of the extra checks when debug_assertions is enabled, Jiff tries
to use these routines wherever possible in lieu of as. The primary
downside of using this trait is that it doesn't work in a const context
because Rust does not yet support generics in const.
Required Methods
fn as_i8(self) -> i8fn as_i16(self) -> i16fn as_i32(self) -> i32fn as_i64(self) -> i64fn from_i8(n: i8) -> Selffn from_i16(n: i16) -> Selffn from_i32(n: i32) -> Selffn from_i64(n: i64) -> Selffn checked_add(self, n: Self) -> Option<Self>fn checked_mul(self, n: Self) -> Option<Self>