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]
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 Debug for Positive
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl PartialEq for Positive
[src]
fn eq(&self, __arg_0: &Positive) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Positive) -> bool
[src]
This method tests for !=
.
impl PartialOrd for Positive
[src]
fn partial_cmp(&self, __arg_0: &Positive) -> Option<Ordering>
[src]
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, __arg_0: &Positive) -> bool
[src]
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, __arg_0: &Positive) -> 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: &Positive) -> bool
[src]
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, __arg_0: &Positive) -> 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 Positive
[src]
fn clone(&self) -> Positive
[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 Positive
[src]
impl Eq for Positive
[src]
impl Hash for Positive
[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 Positive
[src]
type Output = Positive
The resulting type after applying the +
operator.
fn add(self, other: Positive) -> Positive
[src]
Performs the +
operation.
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 for Positive
[src]
fn add_assign(&mut self, other: Positive)
[src]
Performs the +=
operation.
impl AddAssign<NonNegative> for Positive
[src]
fn add_assign(&mut self, other: NonNegative)
[src]
Performs the +=
operation.
impl Mul for Positive
[src]
type Output = Positive
The resulting type after applying the *
operator.
fn mul(self, other: Positive) -> Positive
[src]
Performs the *
operation.
impl MulAssign for Positive
[src]
fn mul_assign(&mut self, other: Positive)
[src]
Performs the *=
operation.
impl Default for Positive
[src]
impl Display for Positive
[src]
fn fmt(&self, f: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl From<Positive> for NonNegative
[src]
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<Positive> for NonNegative
[src]
fn add_assign(&mut self, other: Positive)
[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<Positive> for NonNegative
[src]
fn mul_assign(&mut self, other: Positive)
[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<Positive> for NonNegative
[src]
fn div_assign(&mut self, other: Positive)
[src]
Performs the /=
operation.