pub(crate) trait Primitive:
Clone
+ Copy
+ Eq
+ PartialEq
+ PartialOrd
+ Ord
+ Debug
+ Display {
Show 13 methods
// Required methods
fn as_i8(self) -> i8;
fn as_i16(self) -> i16;
fn as_i32(self) -> i32;
fn as_i64(self) -> i64;
fn as_i128(self) -> i128;
fn from_i8(n: i8) -> Self;
fn from_i16(n: i16) -> Self;
fn from_i32(n: i32) -> Self;
fn from_i64(n: i64) -> Self;
fn from_i128(n: i128) -> Self;
fn checked_add(self, n: Self) -> Option<Self>;
fn checked_sub(self, n: Self) -> Option<Self>;
fn checked_mul(self, n: Self) -> Option<Self>;
}Expand description
A simple trait for making int as int usable in a generic context.
All of these methods require callers to ensure the cast is correct.
Required Methods§
fn as_i8(self) -> i8
fn as_i16(self) -> i16
fn as_i32(self) -> i32
fn as_i64(self) -> i64
fn as_i128(self) -> i128
fn from_i8(n: i8) -> Self
fn from_i16(n: i16) -> Self
fn from_i32(n: i32) -> Self
fn from_i64(n: i64) -> Self
fn from_i128(n: i128) -> Self
fn checked_add(self, n: Self) -> Option<Self>
fn checked_sub(self, n: Self) -> Option<Self>
fn checked_mul(self, n: Self) -> Option<Self>
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.