Trait Signed

Source
pub trait Signed: PartialOrd + Zero {
    // Required methods
    fn positive(&self) -> bool;
    fn negative(&self) -> bool;
    fn non_negative(&self) -> bool;
    fn non_positive(&self) -> bool;
}
Expand description

Helpful methods for measuring an element’s order relative to 0

Required Methods§

Source

fn positive(&self) -> bool

If this element is strictly greater than zero

Source

fn negative(&self) -> bool

If this element is strictly less than zero

Source

fn non_negative(&self) -> bool

If this element is greater than or equal to zero

Source

fn non_positive(&self) -> bool

If this element is less than or equal to zero

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<G: PartialOrd + Zero> Signed for G

Auto-implemented using default to allow for specialization if desired