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: i8) -> i8

source§

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

source§

impl Saturating for i16

source§

impl Saturating for i32

source§

impl Saturating for i64

source§

impl Saturating for i128

source§

impl Saturating for isize

source§

impl Saturating for u8

source§

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

source§

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

source§

impl Saturating for u16

source§

impl Saturating for u32

source§

impl Saturating for u64

source§

impl Saturating for u128

source§

impl Saturating for usize

Implementors§