Trait gstreamer::prelude::OptionWrappingSub

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

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

Trait for values and Options wrapping substraction.

Implementing this trait leads to the following auto-implementations:

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

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

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

Returns None if at least one argument is None.

Implementations on Foreign Types§

§

impl OptionWrappingSub for i8

§

impl OptionWrappingSub for i16

§

impl OptionWrappingSub for i32

§

impl OptionWrappingSub for i64

§

impl OptionWrappingSub for i128

§

impl OptionWrappingSub for u8

§

impl OptionWrappingSub for u16

§

impl OptionWrappingSub for u32

§

impl OptionWrappingSub for u64

§

impl OptionWrappingSub for u128

§

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

§

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

§

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

§

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

§

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

§

fn opt_wrapping_sub( self, rhs: Option<InnerRhs>, ) -> Option<<Option<T> as OptionWrappingSub<Option<InnerRhs>, InnerRhs>>::Output>

§

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

§

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

§

fn opt_wrapping_sub( self, rhs: Rhs, ) -> Option<<Option<T> as OptionWrappingSub<Rhs>>::Output>

Implementors§

source§

impl OptionWrappingSub for Buffers

source§

impl OptionWrappingSub for Bytes

source§

impl OptionWrappingSub for ClockTime

source§

impl OptionWrappingSub for Default

source§

impl OptionWrappingSub for Other

source§

impl OptionWrappingSub for Percent

§

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

§

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

§

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

§

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