[][src]Struct rust_3d::Positive

pub struct Positive { /* fields omitted */ }

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

Implementations

impl Positive[src]

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

Creates a new Positive if input > 0, fails otherwise

pub fn one() -> Positive[src]

Creates a new Positive with value 1

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

Returns the wrapped value

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

Returns the square root

Trait Implementations

impl Add<NonNegative> for Positive[src]

type Output = Positive

The resulting type after applying the + operator.

impl Add<Positive> for Positive[src]

type Output = Positive

The resulting type after applying the + operator.

impl Add<Positive> for NonNegative[src]

type Output = NonNegative

The resulting type after applying the + operator.

impl AddAssign<NonNegative> for Positive[src]

impl AddAssign<Positive> for Positive[src]

impl AddAssign<Positive> for NonNegative[src]

impl AsRef<f64> for Positive[src]

impl Clone for Positive[src]

impl Copy for Positive[src]

impl Debug for Positive[src]

impl Default for Positive[src]

impl Display for Positive[src]

impl Div<NonNegative> for Positive[src]

type Output = NonNegative

The resulting type after applying the / operator.

impl Div<Positive> for Positive[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 DivAssign<Positive> for NonNegative[src]

impl Eq for Positive[src]

impl From<Positive> for NonNegative[src]

impl Hash for Positive[src]

impl Into<f64> for Positive[src]

impl Mul<NonNegative> for Positive[src]

type Output = NonNegative

The resulting type after applying the * operator.

impl Mul<Positive> for Positive[src]

type Output = Positive

The resulting type after applying the * operator.

impl Mul<Positive> for NonNegative[src]

type Output = NonNegative

The resulting type after applying the * operator.

impl MulAssign<Positive> for Positive[src]

impl MulAssign<Positive> for NonNegative[src]

impl PartialEq<Positive> for Positive[src]

impl PartialOrd<Positive> for Positive[src]

impl StructuralPartialEq for Positive[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

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

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

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

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[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.