pub trait CheckedMul: Sized + Mul<Self, Output = Self> {
// Required method
fn checked_mul(&self, v: &Self) -> Option<Self>;
}
Expand description
Performs multiplication that returns None
instead of wrapping around on underflow or
overflow.
Required Methods§
Sourcefn checked_mul(&self, v: &Self) -> Option<Self>
fn checked_mul(&self, v: &Self) -> Option<Self>
Multiplies two numbers, checking for underflow or overflow. If underflow
or overflow happens, None
is returned.
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.