Trait gstreamer::prelude::OptionSaturatingAdd

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

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

Trait for values and Options saturating addition.

Implementing this trait leads to the following auto-implementations:

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

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

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

Returns None if at least one argument is None.

Implementations on Foreign Types§

§

impl OptionSaturatingAdd for i8

§

impl OptionSaturatingAdd for i16

§

impl OptionSaturatingAdd for i32

§

impl OptionSaturatingAdd for i64

§

impl OptionSaturatingAdd for i128

§

impl OptionSaturatingAdd for u8

§

impl OptionSaturatingAdd for u16

§

impl OptionSaturatingAdd for u32

§

impl OptionSaturatingAdd for u64

§

impl OptionSaturatingAdd for u128

§

impl OptionSaturatingAdd for Duration

source§

impl OptionSaturatingAdd<Signed<u32>> for u32

source§

impl OptionSaturatingAdd<Signed<u64>> for u64

source§

impl OptionSaturatingAdd<Signed<usize>> for usize

§

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

§

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

§

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

§

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

§

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

§

fn opt_saturating_add( self, rhs: Option<InnerRhs>, ) -> Option<<Option<T> as OptionSaturatingAdd<Option<InnerRhs>, InnerRhs>>::Output>

§

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

§

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

§

fn opt_saturating_add( self, rhs: Rhs, ) -> Option<<Option<T> as OptionSaturatingAdd<Rhs>>::Output>

Implementors§

source§

impl OptionSaturatingAdd for Signed<u32>

source§

impl OptionSaturatingAdd for Signed<u64>

source§

impl OptionSaturatingAdd for Signed<usize>

source§

impl OptionSaturatingAdd for Signed<Buffers>

source§

impl OptionSaturatingAdd for Signed<Bytes>

source§

impl OptionSaturatingAdd for Signed<ClockTime>

source§

impl OptionSaturatingAdd for Signed<Default>

source§

impl OptionSaturatingAdd for Signed<Other>

source§

impl OptionSaturatingAdd for Signed<Percent>

source§

impl OptionSaturatingAdd for Buffers

source§

impl OptionSaturatingAdd for Bytes

source§

impl OptionSaturatingAdd for ClockTime

source§

impl OptionSaturatingAdd for Default

source§

impl OptionSaturatingAdd for Other

source§

impl OptionSaturatingAdd for Percent

source§

impl OptionSaturatingAdd<Signed<Buffers>> for Buffers

source§

impl OptionSaturatingAdd<Signed<Bytes>> for Bytes

source§

impl OptionSaturatingAdd<Signed<ClockTime>> for ClockTime

source§

impl OptionSaturatingAdd<Signed<Default>> for Default

source§

impl OptionSaturatingAdd<Signed<Other>> for Other

source§

impl OptionSaturatingAdd<Signed<Percent>> for Percent

source§

impl OptionSaturatingAdd<u32> for Signed<u32>

source§

impl OptionSaturatingAdd<u64> for Signed<u64>

source§

impl OptionSaturatingAdd<usize> for Signed<usize>

source§

impl OptionSaturatingAdd<Buffers> for Signed<Buffers>

source§

impl OptionSaturatingAdd<Bytes> for Signed<Bytes>

source§

impl OptionSaturatingAdd<ClockTime> for Signed<ClockTime>

source§

impl OptionSaturatingAdd<Default> for Signed<Default>

source§

impl OptionSaturatingAdd<Other> for Signed<Other>

source§

impl OptionSaturatingAdd<Percent> for Signed<Percent>

§

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

§

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

§

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

§

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