Trait gstreamer::prelude::OptionCheckedMul

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

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

Trait for values and Options checked multiplication.

Implementing this trait leads to the following auto-implementations:

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

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

Required Associated Types§

type Output

The resulting inner type after applying the multiplication.

Required Methods§

fn opt_checked_mul(self, rhs: Rhs) -> Result<Option<Self::Output>, Error>

Computes the checked multiplication.

  • Returns Ok(Some(result)) if result could be computed.
  • Returns Ok(None) if at least one argument is None.
  • Returns Err(Error::Overflow) if an overflow occured.

Implementations on Foreign Types§

§

impl OptionCheckedMul for i8

§

type Output = i8

§

fn opt_checked_mul( self, rhs: i8, ) -> Result<Option<<i8 as OptionCheckedMul>::Output>, Error>

§

impl OptionCheckedMul for i16

§

type Output = i16

§

fn opt_checked_mul( self, rhs: i16, ) -> Result<Option<<i16 as OptionCheckedMul>::Output>, Error>

§

impl OptionCheckedMul for i32

§

type Output = i32

§

fn opt_checked_mul( self, rhs: i32, ) -> Result<Option<<i32 as OptionCheckedMul>::Output>, Error>

§

impl OptionCheckedMul for i64

§

type Output = i64

§

fn opt_checked_mul( self, rhs: i64, ) -> Result<Option<<i64 as OptionCheckedMul>::Output>, Error>

§

impl OptionCheckedMul for i128

§

type Output = i128

§

fn opt_checked_mul( self, rhs: i128, ) -> Result<Option<<i128 as OptionCheckedMul>::Output>, Error>

§

impl OptionCheckedMul for u8

§

type Output = u8

§

fn opt_checked_mul( self, rhs: u8, ) -> Result<Option<<u8 as OptionCheckedMul>::Output>, Error>

§

impl OptionCheckedMul for u16

§

type Output = u16

§

fn opt_checked_mul( self, rhs: u16, ) -> Result<Option<<u16 as OptionCheckedMul>::Output>, Error>

§

impl OptionCheckedMul for u32

§

type Output = u32

§

fn opt_checked_mul( self, rhs: u32, ) -> Result<Option<<u32 as OptionCheckedMul>::Output>, Error>

§

impl OptionCheckedMul for u64

§

type Output = u64

§

fn opt_checked_mul( self, rhs: u64, ) -> Result<Option<<u64 as OptionCheckedMul>::Output>, Error>

§

impl OptionCheckedMul for u128

§

type Output = u128

§

fn opt_checked_mul( self, rhs: u128, ) -> Result<Option<<u128 as OptionCheckedMul>::Output>, Error>

source§

impl OptionCheckedMul<Signed<Buffers>> for i64

§

type Output = Signed<Buffers>

source§

fn opt_checked_mul( self, rhs: Signed<Buffers>, ) -> Result<Option<Self::Output>, Error>

source§

impl OptionCheckedMul<Signed<Buffers>> for u64

§

type Output = Signed<Buffers>

source§

fn opt_checked_mul( self, rhs: Signed<Buffers>, ) -> Result<Option<Self::Output>, Error>

source§

impl OptionCheckedMul<Signed<Bytes>> for i64

§

type Output = Signed<Bytes>

source§

fn opt_checked_mul( self, rhs: Signed<Bytes>, ) -> Result<Option<Self::Output>, Error>

source§

impl OptionCheckedMul<Signed<Bytes>> for u64

§

type Output = Signed<Bytes>

source§

fn opt_checked_mul( self, rhs: Signed<Bytes>, ) -> Result<Option<Self::Output>, Error>

source§

impl OptionCheckedMul<Signed<ClockTime>> for i64

source§

impl OptionCheckedMul<Signed<ClockTime>> for u64

source§

impl OptionCheckedMul<Signed<Default>> for i64

§

type Output = Signed<Default>

source§

fn opt_checked_mul( self, rhs: Signed<Default>, ) -> Result<Option<Self::Output>, Error>

source§

impl OptionCheckedMul<Signed<Default>> for u64

§

type Output = Signed<Default>

source§

fn opt_checked_mul( self, rhs: Signed<Default>, ) -> Result<Option<Self::Output>, Error>

source§

impl OptionCheckedMul<Signed<Other>> for i64

§

type Output = Signed<Other>

source§

fn opt_checked_mul( self, rhs: Signed<Other>, ) -> Result<Option<Self::Output>, Error>

source§

impl OptionCheckedMul<Signed<Other>> for u64

§

type Output = Signed<Other>

source§

fn opt_checked_mul( self, rhs: Signed<Other>, ) -> Result<Option<Self::Output>, Error>

source§

impl OptionCheckedMul<Signed<Percent>> for i32

§

type Output = Signed<Percent>

source§

fn opt_checked_mul( self, rhs: Signed<Percent>, ) -> Result<Option<Self::Output>, Error>

source§

impl OptionCheckedMul<Signed<Percent>> for u32

§

type Output = Signed<Percent>

source§

fn opt_checked_mul( self, rhs: Signed<Percent>, ) -> Result<Option<Self::Output>, Error>

§

impl OptionCheckedMul<u32> for Duration

source§

impl OptionCheckedMul<Buffers> for u64

source§

impl OptionCheckedMul<Bytes> for u64

§

type Output = Bytes

source§

fn opt_checked_mul(self, rhs: Bytes) -> Result<Option<Bytes>, Error>

source§

impl OptionCheckedMul<ClockTime> for u64

source§

impl OptionCheckedMul<Default> for u64

source§

impl OptionCheckedMul<Other> for u64

§

type Output = Other

source§

fn opt_checked_mul(self, rhs: Other) -> Result<Option<Other>, Error>

source§

impl OptionCheckedMul<Percent> for u32

§

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

§

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

§

fn opt_checked_mul( self, rhs: &Option<InnerRhs>, ) -> Result<Option<<Option<T> as OptionCheckedMul<&Option<InnerRhs>, InnerRhs>>::Output>, Error>

§

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

§

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

§

fn opt_checked_mul( self, rhs: Option<InnerRhs>, ) -> Result<Option<<Option<T> as OptionCheckedMul<Option<InnerRhs>, InnerRhs>>::Output>, Error>

§

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

§

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

§

fn opt_checked_mul( self, rhs: Rhs, ) -> Result<Option<<Option<T> as OptionCheckedMul<Rhs>>::Output>, Error>

Implementors§

source§

impl OptionCheckedMul<i32> for Signed<u32>

source§

impl OptionCheckedMul<i32> for Signed<Percent>

source§

impl OptionCheckedMul<i64> for Signed<u64>

source§

impl OptionCheckedMul<i64> for Signed<Buffers>

source§

impl OptionCheckedMul<i64> for Signed<Bytes>

source§

impl OptionCheckedMul<i64> for Signed<ClockTime>

source§

impl OptionCheckedMul<i64> for Signed<Default>

source§

impl OptionCheckedMul<i64> for Signed<Other>

source§

impl OptionCheckedMul<isize> for Signed<usize>

source§

impl OptionCheckedMul<u32> for Signed<u32>

source§

impl OptionCheckedMul<u32> for Signed<Percent>

source§

impl OptionCheckedMul<u32> for Percent

source§

impl OptionCheckedMul<u64> for Signed<u64>

source§

impl OptionCheckedMul<u64> for Signed<Buffers>

source§

impl OptionCheckedMul<u64> for Signed<Bytes>

source§

impl OptionCheckedMul<u64> for Signed<ClockTime>

source§

impl OptionCheckedMul<u64> for Signed<Default>

source§

impl OptionCheckedMul<u64> for Signed<Other>

source§

impl OptionCheckedMul<u64> for Buffers

source§

impl OptionCheckedMul<u64> for Bytes

source§

impl OptionCheckedMul<u64> for ClockTime

source§

impl OptionCheckedMul<u64> for Default

source§

impl OptionCheckedMul<u64> for Other

source§

impl OptionCheckedMul<usize> for Signed<usize>

§

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

§

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

§

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

§

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