Trait option_operations::rem::OptionWrappingRem[][src]

pub trait OptionWrappingRem<Rhs = Self, InnerRhs = Rhs> {
    type Output;
    fn opt_wrapping_rem(self, rhs: Rhs) -> Option<Self::Output>;
}
Expand description

Trait for values and Options wrapping remainder.

Implementing this type leads to the following auto-implementations:

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

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

Associated Types

The resulting inner type after applying the operation.

Required methods

Computes the remainder, wrapping around at the numeric bounds instead of overflowing.

Returns None if at least one argument is None.

Panics

Most implementations will panic if rhs is 0.

Implementations on Foreign Types

Implementors