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]
fn new(val: f64) -> Result<NonNegative>
Creates a new NonNegative if input >= 0, fails otherwise
fn zero() -> NonNegative
Creates a new NonNegative with value 0
fn one() -> NonNegative
Creates a new NonNegative with value 1
fn get(&self) -> f64
Returns the wrapped value
fn sqrt(&self) -> NonNegative
Returns the square root
Trait Implementations
impl Debug for NonNegative
[src]
impl PartialEq for NonNegative
[src]
fn eq(&self, __arg_0: &NonNegative) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &NonNegative) -> bool
This method tests for !=
.
impl PartialOrd for NonNegative
[src]
fn partial_cmp(&self, __arg_0: &NonNegative) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, __arg_0: &NonNegative) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, __arg_0: &NonNegative) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, __arg_0: &NonNegative) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, __arg_0: &NonNegative) -> bool
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]
fn clone(&self) -> NonNegative
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl From<Positive> for NonNegative
[src]
impl Eq for NonNegative
[src]
impl Hash for NonNegative
[src]
fn hash<H: Hasher>(&self, state: &mut H)
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl Add for NonNegative
[src]
type Output = NonNegative
The resulting type after applying the +
operator
fn add(self, other: NonNegative) -> NonNegative
The method for the +
operator
impl Add<Positive> for NonNegative
[src]
type Output = NonNegative
The resulting type after applying the +
operator
fn add(self, other: Positive) -> NonNegative
The method for the +
operator
impl Mul for NonNegative
[src]
type Output = NonNegative
The resulting type after applying the *
operator
fn mul(self, other: NonNegative) -> NonNegative
The method for the *
operator
impl Mul<Positive> for NonNegative
[src]
type Output = NonNegative
The resulting type after applying the *
operator
fn mul(self, other: Positive) -> NonNegative
The method for the *
operator
impl Div for NonNegative
[src]
type Output = NonNegative
The resulting type after applying the /
operator
fn div(self, other: NonNegative) -> NonNegative
The method for the /
operator
impl Div<Positive> for NonNegative
[src]
type Output = NonNegative
The resulting type after applying the /
operator
fn div(self, other: Positive) -> NonNegative
The method for the /
operator