Skip to main content

CheckedMul

Trait CheckedMul 

Source
pub trait CheckedMul: Sized {
    type Output;

    // Required method
    fn checked_mul(self, v: Self) -> Option<Self::Output>;
}
Expand description

Performs multiplication, returning None if overflow occurred.

Required Associated Types§

Source

type Output

The result type (Self for the primitive impls).

Required Methods§

Source

fn checked_mul(self, v: Self) -> Option<Self::Output>

Multiplies two numbers, checking for overflow. If overflow happens, None is returned.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl CheckedMul for i8

Source§

impl CheckedMul for i16

Source§

impl CheckedMul for i32

Source§

impl CheckedMul for i64

Source§

impl CheckedMul for i128

Source§

impl CheckedMul for isize

Source§

impl CheckedMul for u8

Source§

impl CheckedMul for u16

Source§

impl CheckedMul for u32

Source§

impl CheckedMul for u64

Source§

impl CheckedMul for u128

Source§

impl CheckedMul for usize

Implementors§