Skip to main content

ConstCheckedDiv

Trait ConstCheckedDiv 

Source
pub trait ConstCheckedDiv:
    Sized
    + Div<Output = Self>
    + ConstZero {
    // Required method
    fn checked_div(&self, v: &Self) -> Option<Self>;
}
Expand description

Const-compatible checked division.

Required Methods§

Source

fn checked_div(&self, v: &Self) -> Option<Self>

Checked division. Returns None if the divisor is zero.

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.

Implementations on Foreign Types§

Source§

impl ConstCheckedDiv for u8

Source§

fn checked_div(&self, v: &Self) -> Option<Self>

Source§

impl ConstCheckedDiv for u16

Source§

fn checked_div(&self, v: &Self) -> Option<Self>

Source§

impl ConstCheckedDiv for u32

Source§

fn checked_div(&self, v: &Self) -> Option<Self>

Source§

impl ConstCheckedDiv for u64

Source§

fn checked_div(&self, v: &Self) -> Option<Self>

Source§

impl ConstCheckedDiv for u128

Source§

fn checked_div(&self, v: &Self) -> Option<Self>

Implementors§

Source§

impl<T: ConstMachineWord + MachineWord, const N: usize> ConstCheckedDiv for FixedUInt<T, N>