Struct rust_3d::Positive
[−]
[src]
pub struct Positive { /* fields omitted */ }
Positive, a wrapper for a f64 value, ensuring it is always > 0
Methods
impl Positive
[src]
fn new(val: f64) -> Result<Positive>
Creates a new Positive if input > 0, fails otherwise
fn one() -> Positive
Creates a new Positive with value 1
fn get(&self) -> f64
Returns the wrapped value
fn sqrt(&self) -> Positive
Returns the square root
Trait Implementations
impl Debug for Positive
[src]
impl PartialEq for Positive
[src]
fn eq(&self, __arg_0: &Positive) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Positive) -> bool
This method tests for !=
.
impl PartialOrd for Positive
[src]
fn partial_cmp(&self, __arg_0: &Positive) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, __arg_0: &Positive) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, __arg_0: &Positive) -> 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: &Positive) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, __arg_0: &Positive) -> bool
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl Clone for Positive
[src]
fn clone(&self) -> Positive
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 Eq for Positive
[src]
impl Hash for Positive
[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 Positive
[src]
type Output = Positive
The resulting type after applying the +
operator
fn add(self, other: Positive) -> Positive
The method for the +
operator
impl Add<NonNegative> for Positive
[src]
type Output = Positive
The resulting type after applying the +
operator
fn add(self, other: NonNegative) -> Positive
The method for the +
operator