pub trait DefensiveSaturating {
    fn defensive_saturating_add(self, other: Self) -> Self;
    fn defensive_saturating_sub(self, other: Self) -> Self;
    fn defensive_saturating_mul(self, other: Self) -> Self;
    fn defensive_saturating_accrue(&mut self, other: Self);
    fn defensive_saturating_reduce(&mut self, other: Self);
    fn defensive_saturating_inc(&mut self);
    fn defensive_saturating_dec(&mut self);
Expand description

A variant of Defensive with the same rationale, for the arithmetic operations where in case an infallible operation fails, it saturates.

Required Methods

Return self plus other defensively.

Return self minus other defensively.

Return the product of self and other defensively.

Increase self by other defensively.

Reduce self by other defensively.

Increment self by one defensively.

Decrement self by one defensively.