pub trait CheckedAdd<Rhs = Self>: Sized {
type Output;
// Required method
fn checked_add(&self, rhs: Rhs) -> CtOption<Self>;
}
Expand description
Checked addition.
Required Associated Types§
Required Methods§
Sourcefn checked_add(&self, rhs: Rhs) -> CtOption<Self>
fn checked_add(&self, rhs: Rhs) -> CtOption<Self>
Perform checked subtraction, returning a CtOption
which is_some
only if the operation did not overflow.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.