pub trait Signed: Sized {
// Required methods
fn abs(&self) -> Self;
fn is_positive(&self) -> bool;
fn is_negative(&self) -> bool;
fn is_not_negative(&self) -> bool;
fn is_not_positive(&self) -> bool;
}Required Methods§
fn abs(&self) -> Self
Sourcefn is_positive(&self) -> bool
fn is_positive(&self) -> bool
Returns true if the number is positive and false if the number is zero or negative.
Sourcefn is_negative(&self) -> bool
fn is_negative(&self) -> bool
Returns true if the number is negative and false if the number is zero or positive.
Sourcefn is_not_negative(&self) -> bool
fn is_not_negative(&self) -> bool
For exact arithmetic: Returns true if the number is positive or zero. For approximate arithmetic: returns true if the number is larger than -epsilon
Sourcefn is_not_positive(&self) -> bool
fn is_not_positive(&self) -> bool
For exact arithmetic: Returns true if the number is negative or zero. For approximate arithmetic: returns true if the number is smaller than epsilon
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.