Trait clippy_utilities::OverflowArithmetic
source · [−]pub trait OverflowArithmetic {
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
fn overflow_add(self, other: Self) -> Self
fn overflow_add(self, other: Self) -> Self
Overflow add.
fn overflow_sub(self, other: Self) -> Self
fn overflow_sub(self, other: Self) -> Self
Overflow sub.
fn overflow_mul(self, other: Self) -> Self
fn overflow_mul(self, other: Self) -> Self
Overflow mul.
fn overflow_div(self, other: Self) -> Self
fn overflow_div(self, other: Self) -> Self
Overflow div.
fn overflow_shl(self, other: Self) -> Self
fn overflow_shl(self, other: Self) -> Self
Overflow shl.
fn overflow_shr(self, other: Self) -> Self
fn overflow_shr(self, other: Self) -> Self
Overflow shr.
fn overflow_neg(self) -> Self
fn overflow_neg(self) -> Self
Overflow neg.
fn overflow_rem(self, other: Self) -> Self
fn overflow_rem(self, other: Self) -> Self
Overflow rem.