pub trait CheckedSub: Sized {
type Output;
// Required method
fn checked_sub(self, v: Self) -> Option<Self::Output>;
}Expand description
Performs subtraction, returning None if overflow occurred.
Required Associated Types§
Required Methods§
Sourcefn checked_sub(self, v: Self) -> Option<Self::Output>
fn checked_sub(self, v: Self) -> Option<Self::Output>
Subtracts two numbers, checking for overflow. If overflow happens,
None is returned.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".