pub trait IntPrimitive: Int {
Show 28 methods
// Required methods
fn zero() -> Self;
fn one() -> Self;
fn min_value() -> Self;
fn max_value() -> Self;
fn as_f32(self) -> f32;
fn as_f64(self) -> f64;
fn checked_from<T>(value: T) -> Option<Self>
where Self: Sized + TryFrom<T>;
fn checked_add(self, rhs: Self) -> Option<Self>;
fn checked_sub(self, rhs: Self) -> Option<Self>;
fn checked_mul(self, rhs: Self) -> Option<Self>;
fn checked_div(self, rhs: Self) -> Option<Self>;
fn checked_rem(self, rhs: Self) -> Option<Self>;
fn checked_add_from<T>(self, rhs: T) -> Option<Self>
where Self: Sized + TryFrom<T>;
fn checked_sub_from<T>(self, rhs: T) -> Option<Self>
where Self: Sized + TryFrom<T>;
fn checked_mul_from<T>(self, rhs: T) -> Option<Self>
where Self: Sized + TryFrom<T>;
fn checked_div_from<T>(self, rhs: T) -> Option<Self>
where Self: Sized + TryFrom<T>;
fn checked_rem_from<T>(self, rhs: T) -> Option<Self>
where Self: Sized + TryFrom<T>;
fn saturating_add(self, rhs: Self) -> Self;
fn saturating_sub(self, rhs: Self) -> Self;
fn saturating_mul(self, rhs: Self) -> Self;
fn saturating_add_from<T>(self, rhs: T) -> Option<Self>
where Self: Sized + TryFrom<T>;
fn saturating_sub_from<T>(self, rhs: T) -> Option<Self>
where Self: Sized + TryFrom<T>;
fn saturating_mul_from<T>(self, rhs: T) -> Option<Self>
where Self: Sized + TryFrom<T>;
fn checked_next(self) -> Option<Self>;
fn checked_prev(self) -> Option<Self>;
fn saturating_next(self) -> Self;
fn saturating_prev(self) -> Self;
fn parse_decimal(src: &str) -> Result<Self, ParseIntError>;
}Expand description
Built-in integer coordinate type accepted by closed-open intervals.
Required Methods§
fn zero() -> Self
fn one() -> Self
fn min_value() -> Self
fn max_value() -> Self
fn as_f32(self) -> f32
fn as_f64(self) -> f64
fn checked_from<T>(value: T) -> Option<Self>
fn checked_add(self, rhs: Self) -> Option<Self>
fn checked_sub(self, rhs: Self) -> Option<Self>
fn checked_mul(self, rhs: Self) -> Option<Self>
fn checked_div(self, rhs: Self) -> Option<Self>
fn checked_rem(self, rhs: Self) -> Option<Self>
fn checked_add_from<T>(self, rhs: T) -> Option<Self>
fn checked_sub_from<T>(self, rhs: T) -> Option<Self>
fn checked_mul_from<T>(self, rhs: T) -> Option<Self>
fn checked_div_from<T>(self, rhs: T) -> Option<Self>
fn checked_rem_from<T>(self, rhs: T) -> Option<Self>
fn saturating_add(self, rhs: Self) -> Self
fn saturating_sub(self, rhs: Self) -> Self
fn saturating_mul(self, rhs: Self) -> Self
fn saturating_add_from<T>(self, rhs: T) -> Option<Self>
fn saturating_sub_from<T>(self, rhs: T) -> Option<Self>
fn saturating_mul_from<T>(self, rhs: T) -> Option<Self>
fn checked_next(self) -> Option<Self>
fn checked_prev(self) -> Option<Self>
fn saturating_next(self) -> Self
fn saturating_prev(self) -> Self
fn parse_decimal(src: &str) -> Result<Self, ParseIntError>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".