Trait gstreamer::prelude::OptionSaturatingSub

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

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

Trait for values and Options saturating substraction.

Implementing this trait leads to the following auto-implementations:

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

Note that since the std library doesn’t define any SaturatingSub 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_saturating_sub(self, rhs: Rhs) -> Option<Self::Output>

Computes the substraction saturating at the numeric bounds instead of overflowing.

Returns None if at least one argument is None.

Implementations on Foreign Types§

source§

impl OptionSaturatingSub for i8

source§

impl OptionSaturatingSub for i16

source§

impl OptionSaturatingSub for i32

source§

impl OptionSaturatingSub for i64

source§

impl OptionSaturatingSub for i128

source§

impl OptionSaturatingSub for u8

source§

impl OptionSaturatingSub for u16

source§

impl OptionSaturatingSub for u32

source§

impl OptionSaturatingSub for u64

source§

impl OptionSaturatingSub for u128

source§

impl OptionSaturatingSub for Duration

source§

impl OptionSaturatingSub<Signed<u32>> for u32

source§

impl OptionSaturatingSub<Signed<u64>> for u64

source§

impl OptionSaturatingSub<Signed<usize>> for usize

source§

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

source§

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

source§

fn opt_saturating_sub( self, rhs: &Option<InnerRhs>, ) -> Option<<Option<T> as OptionSaturatingSub<&Option<InnerRhs>, InnerRhs>>::Output>

source§

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

source§

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

source§

fn opt_saturating_sub( self, rhs: Option<InnerRhs>, ) -> Option<<Option<T> as OptionSaturatingSub<Option<InnerRhs>, InnerRhs>>::Output>

source§

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

Implementors§

source§

impl OptionSaturatingSub for Signed<u32>

source§

impl OptionSaturatingSub for Signed<u64>

source§

impl OptionSaturatingSub for Signed<usize>

source§

impl OptionSaturatingSub for Signed<ClockTime>

source§

impl OptionSaturatingSub for Signed<Other>

source§

impl OptionSaturatingSub for Signed<Buffers>

source§

impl OptionSaturatingSub for Signed<Bytes>

source§

impl OptionSaturatingSub for Signed<Default>

source§

impl OptionSaturatingSub for Signed<Percent>

source§

impl OptionSaturatingSub for ClockTime

source§

impl OptionSaturatingSub for Other

source§

impl OptionSaturatingSub for Buffers

source§

impl OptionSaturatingSub for Bytes

source§

impl OptionSaturatingSub for Default

source§

impl OptionSaturatingSub for Percent

source§

impl OptionSaturatingSub<Signed<ClockTime>> for ClockTime

source§

impl OptionSaturatingSub<Signed<Other>> for Other

source§

impl OptionSaturatingSub<Signed<Buffers>> for Buffers

source§

impl OptionSaturatingSub<Signed<Bytes>> for Bytes

source§

impl OptionSaturatingSub<Signed<Default>> for Default

source§

impl OptionSaturatingSub<Signed<Percent>> for Percent

source§

impl OptionSaturatingSub<u32> for Signed<u32>

source§

impl OptionSaturatingSub<u64> for Signed<u64>

source§

impl OptionSaturatingSub<usize> for Signed<usize>

source§

impl OptionSaturatingSub<ClockTime> for Signed<ClockTime>

source§

impl OptionSaturatingSub<Other> for Signed<Other>

source§

impl OptionSaturatingSub<Buffers> for Signed<Buffers>

source§

impl OptionSaturatingSub<Bytes> for Signed<Bytes>

source§

impl OptionSaturatingSub<Default> for Signed<Default>

source§

impl OptionSaturatingSub<Percent> for Signed<Percent>

source§

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

source§

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

source§

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

source§

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