Struct rust_3d::NonNegative [] [src]

pub struct NonNegative { /* fields omitted */ }

NonNegative, a wrapper for a f64 value, ensuring it is always >= 0

Methods

impl NonNegative
[src]

Creates a new NonNegative if input >= 0, fails otherwise

Creates a new NonNegative with value 0

Creates a new NonNegative with value 1

Returns the wrapped value

Returns the square root

Trait Implementations

impl Debug for NonNegative
[src]

Formats the value using the given formatter.

impl PartialEq for NonNegative
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl PartialOrd for NonNegative
[src]

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl Clone for NonNegative
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl From<Positive> for NonNegative
[src]

Performs the conversion.

impl Eq for NonNegative
[src]

impl Hash for NonNegative
[src]

Feeds this value into the given [Hasher]. Read more

Feeds a slice of this type into the given [Hasher]. Read more

impl Add for NonNegative
[src]

The resulting type after applying the + operator

The method for the + operator

impl Add<Positive> for NonNegative
[src]

The resulting type after applying the + operator

The method for the + operator

impl Mul for NonNegative
[src]

The resulting type after applying the * operator

The method for the * operator

impl Mul<Positive> for NonNegative
[src]

The resulting type after applying the * operator

The method for the * operator

impl Div for NonNegative
[src]

The resulting type after applying the / operator

The method for the / operator

impl Div<Positive> for NonNegative
[src]

The resulting type after applying the / operator

The method for the / operator

impl Default for NonNegative
[src]

Returns the "default value" for a type. Read more

impl Display for NonNegative
[src]

Formats the value using the given formatter. Read more