Skip to main content

TrySign

Trait TrySign 

Source
pub trait TrySign {
    // Required method
    fn try_sign(&self) -> Option<f32>;

    // Provided methods
    fn is_sign_positive(&self) -> bool { ... }
    fn is_sign_negative(&self) -> bool { ... }
}
Expand description

A trait for values that can potentially return a sign.

Required Methods§

Source

fn try_sign(&self) -> Option<f32>

Returns the sign of the value, if possible.

Provided Methods§

Source

fn is_sign_positive(&self) -> bool

Returns whether the value is positive. If not possible, returns false.

Source

fn is_sign_negative(&self) -> bool

Returns whether the value is negative. If not possible, returns false.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§