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

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

Trait for values and Options substraction.

Implementing this trait leads to the following auto-implementations:

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

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

Required Associated Types§

The resulting inner type after applying the substraction.

Required Methods§

Computes the substraction.

Returns None if at least one argument is None.

Implementations on Foreign Types§