Trait num_traits::ops::saturating::Saturating

source ·
pub trait Saturating {
    // Required methods
    fn saturating_add(self, v: Self) -> Self;
    fn saturating_sub(self, v: Self) -> Self;
}
Expand description

Saturating math operations. Deprecated, use SaturatingAdd, SaturatingSub and SaturatingMul instead.

Required Methods§

source

fn saturating_add(self, v: Self) -> Self

Saturating addition operator. Returns a+b, saturating at the numeric bounds instead of overflowing.

source

fn saturating_sub(self, v: Self) -> Self

Saturating subtraction operator. Returns a-b, saturating at the numeric bounds instead of overflowing.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl Saturating for i8

source§

fn saturating_add(self, v: Self) -> Self

source§

fn saturating_sub(self, v: Self) -> Self

source§

impl Saturating for i16

source§

fn saturating_add(self, v: Self) -> Self

source§

fn saturating_sub(self, v: Self) -> Self

source§

impl Saturating for i32

source§

fn saturating_add(self, v: Self) -> Self

source§

fn saturating_sub(self, v: Self) -> Self

source§

impl Saturating for i64

source§

fn saturating_add(self, v: Self) -> Self

source§

fn saturating_sub(self, v: Self) -> Self

source§

impl Saturating for i128

source§

fn saturating_add(self, v: Self) -> Self

source§

fn saturating_sub(self, v: Self) -> Self

source§

impl Saturating for isize

source§

fn saturating_add(self, v: Self) -> Self

source§

fn saturating_sub(self, v: Self) -> Self

source§

impl Saturating for u8

source§

fn saturating_add(self, v: Self) -> Self

source§

fn saturating_sub(self, v: Self) -> Self

source§

impl Saturating for u16

source§

fn saturating_add(self, v: Self) -> Self

source§

fn saturating_sub(self, v: Self) -> Self

source§

impl Saturating for u32

source§

fn saturating_add(self, v: Self) -> Self

source§

fn saturating_sub(self, v: Self) -> Self

source§

impl Saturating for u64

source§

fn saturating_add(self, v: Self) -> Self

source§

fn saturating_sub(self, v: Self) -> Self

source§

impl Saturating for u128

source§

fn saturating_add(self, v: Self) -> Self

source§

fn saturating_sub(self, v: Self) -> Self

source§

impl Saturating for usize

source§

fn saturating_add(self, v: Self) -> Self

source§

fn saturating_sub(self, v: Self) -> Self

Implementors§