pub trait OverflowArithmetic {
// Required methods
fn overflow_add(self, other: Self) -> Self;
fn overflow_sub(self, other: Self) -> Self;
fn overflow_mul(self, other: Self) -> Self;
fn overflow_div(self, other: Self) -> Self;
fn overflow_shl(self, other: Self) -> Self;
fn overflow_shr(self, other: Self) -> Self;
fn overflow_neg(self) -> Self;
fn overflow_rem(self, other: Self) -> Self;
}Expand description
A type cast trait used to do the integer arithmetic.
Required Methods§
Sourcefn overflow_add(self, other: Self) -> Self
fn overflow_add(self, other: Self) -> Self
Overflow add.
Sourcefn overflow_sub(self, other: Self) -> Self
fn overflow_sub(self, other: Self) -> Self
Overflow sub.
Sourcefn overflow_mul(self, other: Self) -> Self
fn overflow_mul(self, other: Self) -> Self
Overflow mul.
Sourcefn overflow_div(self, other: Self) -> Self
fn overflow_div(self, other: Self) -> Self
Overflow div.
Sourcefn overflow_shl(self, other: Self) -> Self
fn overflow_shl(self, other: Self) -> Self
Overflow shl.
Sourcefn overflow_shr(self, other: Self) -> Self
fn overflow_shr(self, other: Self) -> Self
Overflow shr.
Sourcefn overflow_neg(self) -> Self
fn overflow_neg(self) -> Self
Overflow neg.
Sourcefn overflow_rem(self, other: Self) -> Self
fn overflow_rem(self, other: Self) -> Self
Overflow rem.
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.