AssertNumericIdentity

Trait AssertNumericIdentity 

Source
pub trait AssertNumericIdentity {
    // Required methods
    fn is_zero(self) -> Self;
    fn is_one(self) -> Self;
}
Expand description

Assert the additive and multiplicative identity of a number.

§Examples

use asserting::prelude::*;

assert_that!(0).is_zero();
assert_that!(1).is_one();
assert_that!(0.0).is_zero();
assert_that!(1.0).is_one();

Required Methods§

Source

fn is_zero(self) -> Self

Verifies whether the subject is the additive identity (zero).

§Examples
use asserting::prelude::*;

assert_that!(0).is_zero();
assert_that!(0.0).is_zero();
Source

fn is_one(self) -> Self

Verifies whether the subject is the multiplicative identity (one).

§Examples
use asserting::prelude::*;

assert_that!(1).is_one();
assert_that!(1.0).is_one();

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.

Implementors§