Trait gstreamer::prelude::OptionWrappingAdd

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

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

Trait for values and Options wrapping addition.

Implementing this trait leads to the following auto-implementations:

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

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

Required Associated Types§

type Output

The resulting inner type after applying the addition.

Required Methods§

fn opt_wrapping_add(self, rhs: Rhs) -> Option<Self::Output>

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

Returns None if at least one argument is None.

Implementations on Foreign Types§

§

impl OptionWrappingAdd for i8

§

impl OptionWrappingAdd for i16

§

impl OptionWrappingAdd for i32

§

impl OptionWrappingAdd for i64

§

impl OptionWrappingAdd for i128

§

impl OptionWrappingAdd for u8

§

impl OptionWrappingAdd for u16

§

impl OptionWrappingAdd for u32

§

impl OptionWrappingAdd for u64

§

impl OptionWrappingAdd for u128

§

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

§

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

§

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

§

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

§

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

§

fn opt_wrapping_add( self, rhs: Option<InnerRhs>, ) -> Option<<Option<T> as OptionWrappingAdd<Option<InnerRhs>, InnerRhs>>::Output>

§

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

§

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

§

fn opt_wrapping_add( self, rhs: Rhs, ) -> Option<<Option<T> as OptionWrappingAdd<Rhs>>::Output>

Implementors§

source§

impl OptionWrappingAdd for Buffers

source§

impl OptionWrappingAdd for Bytes

source§

impl OptionWrappingAdd for ClockTime

source§

impl OptionWrappingAdd for Default

source§

impl OptionWrappingAdd for Other

source§

impl OptionWrappingAdd for Percent

§

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

§

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

§

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

§

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