pub trait NumAssertions<T: Num> {
// Required methods
fn is_zero(self) -> Self;
fn is_additive_identity(self) -> Self;
fn is_one(self) -> Self;
fn is_multiplicative_identity(self) -> Self;
fn is_negative(self) -> Self
where T: Signed;
fn is_positive(self) -> Self
where T: Signed;
fn is_close_to(self, expected: T, allowed_deviation: T) -> Self
where T: PartialOrd + Clone;
fn is_nan(self) -> Self
where T: Float;
fn is_finite(self) -> Self
where T: Float;
fn is_infinite(self) -> Self
where T: Float;
}Expand description
Assertions for numeric values not already handled by crate::prelude::PartialEqAssertions and crate::prelude::PartialOrdAssertions.
Required Methods§
fn is_additive_identity(self) -> Self
fn is_multiplicative_identity(self) -> Self
fn is_negative(self) -> Selfwhere
T: Signed,
fn is_positive(self) -> Selfwhere
T: Signed,
Sourcefn is_close_to(self, expected: T, allowed_deviation: T) -> Selfwhere
T: PartialOrd + Clone,
fn is_close_to(self, expected: T, allowed_deviation: T) -> Selfwhere
T: PartialOrd + Clone,
Fails if actual is not in the range
[expected - allowed_deviation, expected + allowed_deviation].
fn is_nan(self) -> Selfwhere
T: Float,
fn is_finite(self) -> Selfwhere
T: Float,
fn is_infinite(self) -> Selfwhere
T: Float,
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.