Trait AssertNotANumber

Source
pub trait AssertNotANumber {
    // Required methods
    fn is_not_a_number(self) -> Self;
    fn is_a_number(self) -> Self;
}
Expand description

Assert whether a numeric value is not a number.

§Examples

use asserting::prelude::*;

assert_that!(0.1).is_a_number();
assert_that!(0.0).is_a_number();
assert_that!(f32::NAN).is_not_a_number();
assert_that!(f64::NAN).is_not_a_number();

Required Methods§

Source

fn is_not_a_number(self) -> Self

Verifies that the subject is not a number.

§Examples
use asserting::prelude::*;

assert_that!(f32::NAN).is_not_a_number();
assert_that!(f64::NAN).is_not_a_number();
Source

fn is_a_number(self) -> Self

Verifies that the subject is a number.

§Examples
use asserting::prelude::*;

assert_that!(0.1).is_a_number();
assert_that!(0.0).is_a_number();
assert_that!(-0.1).is_a_number();

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§

Source§

impl<S, R> AssertNotANumber for Spec<'_, S, R>