Trait gstreamer::prelude::OptionCheckedMul

source ·
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§

source

type Output

The resulting inner type after applying the multiplication.

Required Methods§

source

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§

source§

impl OptionCheckedMul for i8

source§

impl OptionCheckedMul for i16

source§

impl OptionCheckedMul for i32

source§

impl OptionCheckedMul for i64

source§

impl OptionCheckedMul for i128

source§

impl OptionCheckedMul for u8

source§

impl OptionCheckedMul for u16

source§

impl OptionCheckedMul for u32

source§

impl OptionCheckedMul for u64

source§

impl OptionCheckedMul for u128

source§

impl OptionCheckedMul<Signed<ClockTime>> for i64

source§

impl OptionCheckedMul<Signed<ClockTime>> for u64

source§

impl OptionCheckedMul<Signed<Other>> for i64

source§

impl OptionCheckedMul<Signed<Other>> for u64

source§

impl OptionCheckedMul<Signed<Buffers>> for i64

source§

impl OptionCheckedMul<Signed<Buffers>> for u64

source§

impl OptionCheckedMul<Signed<Bytes>> for i64

source§

impl OptionCheckedMul<Signed<Bytes>> for u64

source§

impl OptionCheckedMul<Signed<Default>> for i64

source§

impl OptionCheckedMul<Signed<Default>> for u64

source§

impl OptionCheckedMul<Signed<Percent>> for i32

source§

impl OptionCheckedMul<Signed<Percent>> for u32

source§

impl OptionCheckedMul<u32> for Duration

source§

impl OptionCheckedMul<ClockTime> for u64

source§

impl OptionCheckedMul<Other> for u64

source§

impl OptionCheckedMul<Buffers> for u64

source§

impl OptionCheckedMul<Bytes> for u64

source§

impl OptionCheckedMul<Default> for u64

source§

impl OptionCheckedMul<Percent> for u32

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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<ClockTime>

source§

impl OptionCheckedMul<i64> for Signed<Other>

source§

impl OptionCheckedMul<i64> for Signed<Buffers>

source§

impl OptionCheckedMul<i64> for Signed<Bytes>

source§

impl OptionCheckedMul<i64> for Signed<Default>

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<ClockTime>

source§

impl OptionCheckedMul<u64> for Signed<Other>

source§

impl OptionCheckedMul<u64> for Signed<Buffers>

source§

impl OptionCheckedMul<u64> for Signed<Bytes>

source§

impl OptionCheckedMul<u64> for Signed<Default>

source§

impl OptionCheckedMul<u64> for ClockTime

source§

impl OptionCheckedMul<u64> for Other

source§

impl OptionCheckedMul<u64> for Buffers

source§

impl OptionCheckedMul<u64> for Bytes

source§

impl OptionCheckedMul<u64> for Default

source§

impl OptionCheckedMul<usize> for Signed<usize>

source§

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

source§

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

source§

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

source§

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