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]
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 Add<NonNegative> for Positive[src]
type Output = Positive
The resulting type after applying the + operator.
fn add(self, other: NonNegative) -> Positive[src]
Performs the + operation.
impl AddAssign<NonNegative> for Positive[src]
fn add_assign(&mut self, other: NonNegative)[src]
Performs the += operation.
impl Debug for NonNegative[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result[src]
Formats the value using the given formatter. Read more
impl PartialEq for NonNegative[src]
fn eq(&self, __arg_0: &NonNegative) -> bool[src]
This method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, __arg_0: &NonNegative) -> bool[src]
This method tests for !=.
impl PartialOrd for NonNegative[src]
fn partial_cmp(&self, __arg_0: &NonNegative) -> Option<Ordering>[src]
This method returns an ordering between self and other values if one exists. Read more
fn lt(&self, __arg_0: &NonNegative) -> bool[src]
This method tests less than (for self and other) and is used by the < operator. Read more
fn le(&self, __arg_0: &NonNegative) -> bool[src]
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[src]
This method tests greater than (for self and other) and is used by the > operator. Read more
fn ge(&self, __arg_0: &NonNegative) -> bool[src]
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[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
Performs copy-assignment from source. Read more
impl Copy for NonNegative[src]
impl From<Positive> for NonNegative[src]
impl Eq for NonNegative[src]
impl Hash for NonNegative[src]
fn hash<H: Hasher>(&self, state: &mut H)[src]
Feeds this value into the given [Hasher]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher, 1.3.0[src]
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[src]
Performs the + operation.
impl Add<Positive> for NonNegative[src]
type Output = NonNegative
The resulting type after applying the + operator.
fn add(self, other: Positive) -> NonNegative[src]
Performs the + operation.
impl AddAssign for NonNegative[src]
fn add_assign(&mut self, other: NonNegative)[src]
Performs the += operation.
impl AddAssign<Positive> for NonNegative[src]
fn add_assign(&mut self, other: Positive)[src]
Performs the += operation.
impl Mul for NonNegative[src]
type Output = NonNegative
The resulting type after applying the * operator.
fn mul(self, other: NonNegative) -> NonNegative[src]
Performs the * operation.
impl Mul<Positive> for NonNegative[src]
type Output = NonNegative
The resulting type after applying the * operator.
fn mul(self, other: Positive) -> NonNegative[src]
Performs the * operation.
impl MulAssign for NonNegative[src]
fn mul_assign(&mut self, other: NonNegative)[src]
Performs the *= operation.
impl MulAssign<Positive> for NonNegative[src]
fn mul_assign(&mut self, other: Positive)[src]
Performs the *= operation.
impl Div for NonNegative[src]
type Output = NonNegative
The resulting type after applying the / operator.
fn div(self, other: NonNegative) -> NonNegative[src]
Performs the / operation.
impl Div<Positive> for NonNegative[src]
type Output = NonNegative
The resulting type after applying the / operator.
fn div(self, other: Positive) -> NonNegative[src]
Performs the / operation.
impl DivAssign for NonNegative[src]
fn div_assign(&mut self, other: NonNegative)[src]
Performs the /= operation.
impl DivAssign<Positive> for NonNegative[src]
fn div_assign(&mut self, other: Positive)[src]
Performs the /= operation.