Trait gstreamer::prelude::OptionOverflowingDiv

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

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

Trait for values and Options overflowing division.

Implementing this trait leads to the following auto-implementations:

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

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

Required Associated Types§

type Output

The resulting inner type after applying the division.

Required Methods§

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

Returns a tuple of the division along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would have occurred then self is returned.

Returns None if at least one argument is None.

§Panics

Most implementations will panic if rhs is zero.

Implementations on Foreign Types§

§

impl OptionOverflowingDiv for i8

§

impl OptionOverflowingDiv for i16

§

impl OptionOverflowingDiv for i32

§

impl OptionOverflowingDiv for i64

§

impl OptionOverflowingDiv for i128

§

impl OptionOverflowingDiv for u8

§

impl OptionOverflowingDiv for u16

§

impl OptionOverflowingDiv for u32

§

impl OptionOverflowingDiv for u64

§

impl OptionOverflowingDiv for u128

§

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

§

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

§

fn opt_overflowing_div( self, rhs: &Option<InnerRhs>, ) -> Option<(<Option<T> as OptionOverflowingDiv<&Option<InnerRhs>, InnerRhs>>::Output, bool)>

§

impl<T, InnerRhs> OptionOverflowingDiv<Option<InnerRhs>, InnerRhs> for Option<T>

§

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

§

fn opt_overflowing_div( self, rhs: Option<InnerRhs>, ) -> Option<(<Option<T> as OptionOverflowingDiv<Option<InnerRhs>, InnerRhs>>::Output, bool)>

§

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

§

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

§

fn opt_overflowing_div( self, rhs: Rhs, ) -> Option<(<Option<T> as OptionOverflowingDiv<Rhs>>::Output, bool)>

Implementors§

§

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

§

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

§

impl<T, InnerRhs> OptionOverflowingDiv<Option<InnerRhs>, InnerRhs> for T

§

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