pub trait Magnitude:
Copy
+ PartialEq
+ PartialOrd {
const ZERO: Self;
// Required methods
fn abs_diff(self, other: Self) -> Self;
fn checked_add(self, other: Self) -> Option<Self>;
fn checked_sub(self, other: Self) -> Option<Self>;
// Provided method
fn is_zero(self) -> bool { ... }
}Expand description
Required Associated Constants§
Required Methods§
Sourcefn checked_add(self, other: Self) -> Option<Self>
fn checked_add(self, other: Self) -> Option<Self>
Checked addition. Returns None if overflow occurred.
Sourcefn checked_sub(self, other: Self) -> Option<Self>
fn checked_sub(self, other: Self) -> Option<Self>
Checked subtraction. Returns None if underflow occurred.
Provided Methods§
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.