#[non_exhaustive]pub enum MathOp {
Add,
Sub,
Mul,
Div,
Rem,
Neg,
}Expand description
The math operation that caused the error.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Add
Addition failed (core::ops::Add resulted in an invalid value).
Sub
Subtraction failed (core::ops::Sub resulted in an invalid value).
Mul
Multiplication failed (core::ops::Mul resulted in an invalid value).
Div
Division failed (core::ops::Div attempted div-by-zero).
Rem
Calculating the remainder failed (core::ops::Rem attempted div-by-zero).
Neg
Negation failed (core::ops::Neg resulted in an invalid value).
Implementations§
Source§impl MathOp
impl MathOp
Sourcepub fn is_overflow(self) -> bool
pub fn is_overflow(self) -> bool
Returns true if this operation error’ed due to overflow.
Sourcepub fn is_div_by_zero(self) -> bool
pub fn is_div_by_zero(self) -> bool
Returns true if this operation error’ed due to division by zero.
Sourcepub fn is_addition(self) -> bool
pub fn is_addition(self) -> bool
Returns true if this operation error’ed due to addition.
Sourcepub fn is_subtraction(self) -> bool
pub fn is_subtraction(self) -> bool
Returns true if this operation error’ed due to subtraction.
Sourcepub fn is_multiplication(self) -> bool
pub fn is_multiplication(self) -> bool
Returns true if this operation error’ed due to multiplication.
Sourcepub fn is_negation(self) -> bool
pub fn is_negation(self) -> bool
Returns true if this operation error’ed due to negation.
Trait Implementations§
Source§impl<'a> Arbitrary<'a> for MathOp
Available on crate feature arbitrary only.
impl<'a> Arbitrary<'a> for MathOp
arbitrary only.Source§fn arbitrary(u: &mut Unstructured<'a>) -> Result<Self>
fn arbitrary(u: &mut Unstructured<'a>) -> Result<Self>
Self from the given unstructured data. Read moreSource§fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<Self, Error>
fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<Self, Error>
Self from the entirety of the given
unstructured data. Read moreSource§fn size_hint(depth: usize) -> (usize, Option<usize>)
fn size_hint(depth: usize) -> (usize, Option<usize>)
Unstructured this type
needs to construct itself. Read moreSource§fn try_size_hint(
depth: usize,
) -> Result<(usize, Option<usize>), MaxRecursionReached>
fn try_size_hint( depth: usize, ) -> Result<(usize, Option<usize>), MaxRecursionReached>
Unstructured this type
needs to construct itself. Read more