Trait gstreamer::prelude::OptionOverflowingRem

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

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

Trait for values and Options overflowing remainder.

Implementing this trait leads to the following auto-implementations:

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

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

Required Associated Types§

type Output

The resulting inner type after applying the remainder.

Required Methods§

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

Returns a tuple of the remainder 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 OptionOverflowingRem for i8

§

impl OptionOverflowingRem for i16

§

impl OptionOverflowingRem for i32

§

impl OptionOverflowingRem for i64

§

impl OptionOverflowingRem for i128

§

impl OptionOverflowingRem for u8

§

impl OptionOverflowingRem for u16

§

impl OptionOverflowingRem for u32

§

impl OptionOverflowingRem for u64

§

impl OptionOverflowingRem for u128

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

Implementors§

§

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

§

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

§

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

§

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