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;
}
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§

Add self and other defensively.

Subtract other from self defensively.

Multiply self and other defensively.

Implementors§