pub trait OptionWrappingDiv<Rhs = Self, InnerRhs = Rhs> {
    type Output;

    fn opt_wrapping_div(self, rhs: Rhs) -> Option<Self::Output>;
}
Expand description

Trait for values and Options wrapping division.

Implementing this trait leads to the following auto-implementations:

  • OptionWrappingDiv<Option<InnerRhs>> for T.
  • OptionWrappingDiv<Rhs> for Option<T>.
  • OptionWrappingDiv<Option<InnerRhs>> for Option<T>.
  • … and some variants with references.

Note that since the std library doesn’t define any WrappingDiv trait, users must provide the base implementation for the inner type.

Required Associated Types

The resulting inner type after applying the division.

Required Methods

Computes the division wrapping at the numeric bounds instead of overflowing.

Returns None if at least one argument is None.

Panics

Most implementations will panic if rhs is zero.

Implementations on Foreign Types

Implementors