[][src]Struct rust_3d::NonNegative

pub struct NonNegative { /* fields omitted */ }

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

Methods

impl NonNegative[src]

pub fn new(val: f64) -> Result<NonNegative>[src]

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

pub fn zero() -> NonNegative[src]

Creates a new NonNegative with value 0

pub fn one() -> NonNegative[src]

Creates a new NonNegative with value 1

pub fn get(&self) -> f64[src]

Returns the wrapped value

pub fn sqrt(&self) -> NonNegative[src]

Returns the square root

Trait Implementations

impl PartialOrd<NonNegative> for NonNegative[src]

impl PartialEq<NonNegative> for NonNegative[src]

impl Copy for NonNegative[src]

impl Eq for NonNegative[src]

impl Default for NonNegative[src]

impl From<Positive> for NonNegative[src]

impl Clone for NonNegative[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Hash for NonNegative[src]

fn hash_slice<H>(data: &[Self], state: &mut H) where
    H: Hasher
1.3.0[src]

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

impl Add<NonNegative> for Positive[src]

type Output = Positive

The resulting type after applying the + operator.

impl Add<NonNegative> for NonNegative[src]

type Output = NonNegative

The resulting type after applying the + operator.

impl Add<Positive> for NonNegative[src]

type Output = NonNegative

The resulting type after applying the + operator.

impl Mul<NonNegative> for NonNegative[src]

type Output = NonNegative

The resulting type after applying the * operator.

impl Mul<Positive> for NonNegative[src]

type Output = NonNegative

The resulting type after applying the * operator.

impl Div<NonNegative> for NonNegative[src]

type Output = NonNegative

The resulting type after applying the / operator.

impl Div<Positive> for NonNegative[src]

type Output = NonNegative

The resulting type after applying the / operator.

impl AddAssign<NonNegative> for Positive[src]

impl AddAssign<NonNegative> for NonNegative[src]

impl AddAssign<Positive> for NonNegative[src]

impl MulAssign<NonNegative> for NonNegative[src]

impl MulAssign<Positive> for NonNegative[src]

impl DivAssign<NonNegative> for NonNegative[src]

impl DivAssign<Positive> for NonNegative[src]

impl Debug for NonNegative[src]

impl Display for NonNegative[src]

Auto Trait Implementations

Blanket Implementations

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]