Trait gstreamer::prelude::OptionDiv

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

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

Trait for values and Options division.

Implementing this trait leads to the following auto-implementations:

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

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

Required Associated Types§

type Output

The resulting inner type after applying the division.

Required Methods§

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

Computes the division.

Returns None if at least one argument is None.

§Panics

Most implementations will panic if rhs is zero.

Implementations on Foreign Types§

§

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

§

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

§

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

§

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

§

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

§

fn opt_div( self, rhs: Option<InnerRhs>, ) -> Option<<Option<T> as OptionDiv<Option<InnerRhs>, InnerRhs>>::Output>

§

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

§

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

§

fn opt_div(self, rhs: Rhs) -> Option<<Option<T> as OptionDiv<Rhs>>::Output>

Implementors§

§

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

§

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

§

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

§

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

§

impl<T, Rhs> OptionDiv<Rhs> for T
where T: OptionOperations + Div<Rhs>,

§

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