Trait option_operations::rem::OptionRem

source ·
pub trait OptionRem<Rhs = Self, InnerRhs = Rhs> {
    type Output;

    // Required method
    fn opt_rem(self, rhs: Rhs) -> Option<Self::Output>;
}
Expand description

Trait for values and Options remainder.

Implementing this trait leads to the following auto-implementations:

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

This trait is auto-implemented for OptionOperations types implementing Rem<Rhs>.

Required Associated Types§

source

type Output

The resulting inner type after applying the remainder.

Required Methods§

source

fn opt_rem(self, rhs: Rhs) -> Option<Self::Output>

Computes the remainder.

Returns None if at least one argument is None.

§Panics

Most implementations will panic if rhs is zero.

Implementations on Foreign Types§

source§

impl<T, InnerRhs> OptionRem<&Option<InnerRhs>, InnerRhs> for Option<T>
where T: OptionOperations + OptionRem<InnerRhs>, InnerRhs: Copy,

source§

type Output = <T as OptionRem<InnerRhs>>::Output

source§

fn opt_rem(self, rhs: &Option<InnerRhs>) -> Option<Self::Output>

source§

impl<T, InnerRhs> OptionRem<Option<InnerRhs>, InnerRhs> for Option<T>
where T: OptionOperations + OptionRem<InnerRhs>,

source§

type Output = <T as OptionRem<InnerRhs>>::Output

source§

fn opt_rem(self, rhs: Option<InnerRhs>) -> Option<Self::Output>

source§

impl<T, Rhs> OptionRem<Rhs> for Option<T>
where T: OptionOperations + OptionRem<Rhs>,

source§

type Output = <T as OptionRem<Rhs>>::Output

source§

fn opt_rem(self, rhs: Rhs) -> Option<Self::Output>

Implementors§

source§

impl<T, InnerRhs> OptionRem<&Option<InnerRhs>, InnerRhs> for T
where T: OptionOperations + OptionRem<InnerRhs>, InnerRhs: Copy,

source§

type Output = <T as OptionRem<InnerRhs>>::Output

source§

impl<T, InnerRhs> OptionRem<Option<InnerRhs>, InnerRhs> for T
where T: OptionOperations + OptionRem<InnerRhs>,

source§

type Output = <T as OptionRem<InnerRhs>>::Output

source§

impl<T, Rhs> OptionRem<Rhs> for T
where T: OptionOperations + Rem<Rhs>,

source§

type Output = <T as Rem<Rhs>>::Output