Trait gstreamer::prelude::OptionCheckedSub

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

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

Trait for values and Options checked substraction.

Implementing this trait leads to the following auto-implementations:

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

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

Required Associated Types§

source

type Output

The resulting inner type after applying the substraction.

Required Methods§

source

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

Computes the checked substraction.

  • 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 OptionCheckedSub for i8

source§

impl OptionCheckedSub for i16

source§

impl OptionCheckedSub for i32

source§

impl OptionCheckedSub for i64

source§

impl OptionCheckedSub for i128

source§

impl OptionCheckedSub for u8

source§

impl OptionCheckedSub for u16

source§

impl OptionCheckedSub for u32

source§

impl OptionCheckedSub for u64

source§

impl OptionCheckedSub for u128

source§

impl OptionCheckedSub for Duration

source§

impl OptionCheckedSub<Signed<u32>> for u32

source§

impl OptionCheckedSub<Signed<u64>> for u64

source§

impl OptionCheckedSub<Signed<usize>> for usize

source§

impl OptionCheckedSub<Duration> for Instant

source§

impl OptionCheckedSub<Duration> for SystemTime

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

Implementors§

source§

impl OptionCheckedSub for Signed<u32>

source§

impl OptionCheckedSub for Signed<u64>

source§

impl OptionCheckedSub for Signed<usize>

source§

impl OptionCheckedSub for Signed<ClockTime>

source§

impl OptionCheckedSub for Signed<Other>

source§

impl OptionCheckedSub for Signed<Buffers>

source§

impl OptionCheckedSub for Signed<Bytes>

source§

impl OptionCheckedSub for Signed<Default>

source§

impl OptionCheckedSub for Signed<Percent>

source§

impl OptionCheckedSub for ClockTime

source§

impl OptionCheckedSub for Other

source§

impl OptionCheckedSub for Buffers

source§

impl OptionCheckedSub for Bytes

source§

impl OptionCheckedSub for Default

source§

impl OptionCheckedSub for Percent

source§

impl OptionCheckedSub<Signed<ClockTime>> for ClockTime

source§

impl OptionCheckedSub<Signed<Other>> for Other

source§

impl OptionCheckedSub<Signed<Buffers>> for Buffers

source§

impl OptionCheckedSub<Signed<Bytes>> for Bytes

source§

impl OptionCheckedSub<Signed<Default>> for Default

source§

impl OptionCheckedSub<Signed<Percent>> for Percent

source§

impl OptionCheckedSub<u32> for Signed<u32>

source§

impl OptionCheckedSub<u64> for Signed<u64>

source§

impl OptionCheckedSub<usize> for Signed<usize>

source§

impl OptionCheckedSub<ClockTime> for Signed<ClockTime>

source§

impl OptionCheckedSub<Other> for Signed<Other>

source§

impl OptionCheckedSub<Buffers> for Signed<Buffers>

source§

impl OptionCheckedSub<Bytes> for Signed<Bytes>

source§

impl OptionCheckedSub<Default> for Signed<Default>

source§

impl OptionCheckedSub<Percent> for Signed<Percent>

source§

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

source§

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

source§

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

source§

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