pub trait OptionWrappingRem<Rhs = Self, InnerRhs = Rhs> {
type Output;
// Required method
fn opt_wrapping_rem(self, rhs: Rhs) -> Option<Self::Output>;
}Expand description
Trait for values and Options wrapping remainder.
Implementing this trait leads to the following auto-implementations:
OptionWrappingRem<Option<InnerRhs>>forT.OptionWrappingRem<Rhs>forOption<T>.OptionWrappingRem<Option<InnerRhs>>forOption<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.
Required Associated Types§
Required Methods§
Sourcefn opt_wrapping_rem(self, rhs: Rhs) -> Option<Self::Output>
fn opt_wrapping_rem(self, rhs: Rhs) -> Option<Self::Output>
Computes the remainder 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.