Trait gstreamer::prelude::OptionWrappingDiv

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

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

Trait for values and Options wrapping division.

Implementing this trait leads to the following auto-implementations:

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

Note that since the std library doesn’t define any WrappingDiv trait, users must provide the base implementation for the inner type.

Required Associated Types§

source

type Output

The resulting inner type after applying the division.

Required Methods§

source

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

Computes the division 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.

Implementations on Foreign Types§

source§

impl OptionWrappingDiv for i8

source§

impl OptionWrappingDiv for i16

source§

impl OptionWrappingDiv for i32

source§

impl OptionWrappingDiv for i64

source§

impl OptionWrappingDiv for i128

source§

impl OptionWrappingDiv for u8

source§

impl OptionWrappingDiv for u16

source§

impl OptionWrappingDiv for u32

source§

impl OptionWrappingDiv for u64

source§

impl OptionWrappingDiv for u128

source§

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

source§

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

source§

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

source§

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

source§

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

source§

fn opt_wrapping_div( self, rhs: Option<InnerRhs>, ) -> Option<<Option<T> as OptionWrappingDiv<Option<InnerRhs>, InnerRhs>>::Output>

source§

impl<T, Rhs> OptionWrappingDiv<Rhs> for Option<T>

source§

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

source§

fn opt_wrapping_div( self, rhs: Rhs, ) -> Option<<Option<T> as OptionWrappingDiv<Rhs>>::Output>

Implementors§

source§

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

source§

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

source§

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

source§

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