pub trait AssertSignum {
// Required methods
fn is_negative(self) -> Self;
fn is_not_negative(self) -> Self;
fn is_positive(self) -> Self;
fn is_not_positive(self) -> Self;
}Expand description
Assert whether a numeric value is negative or positive.
§Examples
use asserting::prelude::*;
assert_that!(-42).is_negative();
assert_that!(42).is_positive();
assert_that!(0).is_not_negative();
assert_that!(1).is_not_negative();
assert_that!(0).is_not_positive();
assert_that!(-1).is_not_positive();
assert_that!(-0.1).is_negative();
assert_that!(0.1).is_positive();
assert_that!(0.0).is_not_negative();
assert_that!(0.1).is_not_negative();
assert_that!(0.0).is_not_positive();
assert_that!(-0.1).is_not_positive();Required Methods§
Sourcefn is_negative(self) -> Self
fn is_negative(self) -> Self
Verifies that the subject is a negative number.
This is equivalent to asserting that a number is less than 0.
Sourcefn is_not_negative(self) -> Self
fn is_not_negative(self) -> Self
Verifies that the subject is a non-negative number.
This is equivalent to asserting that a number is greater than or equal to 0.
Sourcefn is_positive(self) -> Self
fn is_positive(self) -> Self
Verifies that the subject is a positive number.
This is equivalent to asserting that a number is greater than 0.
Sourcefn is_not_positive(self) -> Self
fn is_not_positive(self) -> Self
Verifies that the subject is a non-positive number.
This is equivalent to asserting that a number is less than or equal to 0.
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.