[−][src]Struct rust_3d::Positive
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.
fn add(self, other: NonNegative) -> Positive
[src]
impl Add<Positive> for Positive
[src]
type Output = Positive
The resulting type after applying the +
operator.
fn add(self, other: Positive) -> Positive
[src]
impl Add<Positive> for NonNegative
[src]
type Output = NonNegative
The resulting type after applying the +
operator.
fn add(self, other: Positive) -> NonNegative
[src]
impl AddAssign<NonNegative> for Positive
[src]
fn add_assign(&mut self, other: NonNegative)
[src]
impl AddAssign<Positive> for Positive
[src]
fn add_assign(&mut self, other: Positive)
[src]
impl AddAssign<Positive> for NonNegative
[src]
fn add_assign(&mut self, other: Positive)
[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.
fn div(self, other: NonNegative) -> NonNegative
[src]
impl Div<Positive> for Positive
[src]
type Output = NonNegative
The resulting type after applying the /
operator.
fn div(self, other: Positive) -> NonNegative
[src]
impl Div<Positive> for NonNegative
[src]
type Output = NonNegative
The resulting type after applying the /
operator.
fn div(self, other: Positive) -> NonNegative
[src]
impl DivAssign<Positive> for NonNegative
[src]
fn div_assign(&mut self, other: Positive)
[src]
impl Eq for Positive
[src]
impl From<Positive> for NonNegative
[src]
impl Hash for Positive
[src]
fn hash<H: Hasher>(&self, state: &mut H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Into<f64> for Positive
[src]
impl Mul<NonNegative> for Positive
[src]
type Output = NonNegative
The resulting type after applying the *
operator.
fn mul(self, other: NonNegative) -> NonNegative
[src]
impl Mul<Positive> for Positive
[src]
type Output = Positive
The resulting type after applying the *
operator.
fn mul(self, other: Positive) -> Positive
[src]
impl Mul<Positive> for NonNegative
[src]
type Output = NonNegative
The resulting type after applying the *
operator.
fn mul(self, other: Positive) -> NonNegative
[src]
impl MulAssign<Positive> for Positive
[src]
fn mul_assign(&mut self, other: Positive)
[src]
impl MulAssign<Positive> for NonNegative
[src]
fn mul_assign(&mut self, other: Positive)
[src]
impl PartialEq<Positive> for Positive
[src]
impl PartialOrd<Positive> for Positive
[src]
fn partial_cmp(&self, other: &Positive) -> Option<Ordering>
[src]
fn lt(&self, other: &Positive) -> bool
[src]
fn le(&self, other: &Positive) -> bool
[src]
fn gt(&self, other: &Positive) -> bool
[src]
fn ge(&self, other: &Positive) -> bool
[src]
impl StructuralPartialEq for Positive
[src]
Auto Trait Implementations
impl RefUnwindSafe for Positive
impl Send for Positive
impl Sync for Positive
impl Unpin for Positive
impl UnwindSafe for Positive
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,