Skip to main content

OptionMul

Trait OptionMul 

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

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

Trait for values and Options multiplication.

Implementing this trait leads to the following auto-implementations:

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

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

Required Associated Types§

Source

type Output

The resulting inner type after applying the multiplication.

Required Methods§

Source

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

Computes the multiplication.

Returns None if at least one argument is None.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

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

Source§

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

Source§

fn opt_mul( self, rhs: &Option<InnerRhs>, ) -> Option<<Option<T> as OptionMul<&Option<InnerRhs>, InnerRhs>>::Output>

Source§

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

Source§

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

Source§

fn opt_mul( self, rhs: Option<InnerRhs>, ) -> Option<<Option<T> as OptionMul<Option<InnerRhs>, InnerRhs>>::Output>

Source§

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

Source§

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

Source§

fn opt_mul(self, rhs: Rhs) -> Option<<Option<T> as OptionMul<Rhs>>::Output>

Implementors§

Source§

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

Source§

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

Source§

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

Source§

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

Source§

impl<T, Rhs> OptionMul<Rhs> for T
where T: OptionOperations + Mul<Rhs>,

Source§

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