Trait gstreamer::prelude::OptionSaturatingSub

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§

type Output

The resulting inner type after applying the substraction.

Required Methods§

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§

§

impl OptionSaturatingSub for i8

§

impl OptionSaturatingSub for i16

§

impl OptionSaturatingSub for i32

§

impl OptionSaturatingSub for i64

§

impl OptionSaturatingSub for i128

§

impl OptionSaturatingSub for u8

§

impl OptionSaturatingSub for u16

§

impl OptionSaturatingSub for u32

§

impl OptionSaturatingSub for u64

§

impl OptionSaturatingSub for u128

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

Implementors§

source§

impl OptionSaturatingSub for Signed<u32>

source§

impl OptionSaturatingSub for Signed<u64>

source§

impl OptionSaturatingSub for Signed<usize>

source§

impl OptionSaturatingSub for Signed<Buffers>

source§

impl OptionSaturatingSub for Signed<Bytes>

source§

impl OptionSaturatingSub for Signed<ClockTime>

source§

impl OptionSaturatingSub for Signed<Default>

source§

impl OptionSaturatingSub for Signed<Other>

source§

impl OptionSaturatingSub for Signed<Percent>

source§

impl OptionSaturatingSub for Buffers

source§

impl OptionSaturatingSub for Bytes

source§

impl OptionSaturatingSub for ClockTime

source§

impl OptionSaturatingSub for Default

source§

impl OptionSaturatingSub for Other

source§

impl OptionSaturatingSub for Percent

source§

impl OptionSaturatingSub<Signed<Buffers>> for Buffers

source§

impl OptionSaturatingSub<Signed<Bytes>> for Bytes

source§

impl OptionSaturatingSub<Signed<ClockTime>> for ClockTime

source§

impl OptionSaturatingSub<Signed<Default>> for Default

source§

impl OptionSaturatingSub<Signed<Other>> for Other

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<Buffers> for Signed<Buffers>

source§

impl OptionSaturatingSub<Bytes> for Signed<Bytes>

source§

impl OptionSaturatingSub<ClockTime> for Signed<ClockTime>

source§

impl OptionSaturatingSub<Default> for Signed<Default>

source§

impl OptionSaturatingSub<Other> for Signed<Other>

source§

impl OptionSaturatingSub<Percent> for Signed<Percent>

§

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

§

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

§

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

§

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