[−][src]Struct tiny_uom::Quantity
A Quantity
represents a raw value and it's unit
that is represented as a const generic parameter.
Fields
value: f64
The raw value of this Quantity
Implementations
impl<const U: Unit> Quantity<U>
[src]
Trait Implementations
impl<const U: Unit> Add<Quantity<U>> for Quantity<U>
[src]
type Output = Self
The resulting type after applying the +
operator.
pub fn add(self, rhs: Self) -> Self::Output
[src]
Add the value of two equal units.
impl<const U: Unit> AddAssign<Quantity<U>> for Quantity<U>
[src]
pub fn add_assign(&mut self, rhs: Self)
[src]
Add the value of two equal units.
impl<const U: Unit> Clone for Quantity<U>
[src]
impl<const U: Unit> Copy for Quantity<U>
[src]
impl<const U: Unit> Debug for Quantity<U>
[src]
impl<const U: Unit> Display for Quantity<U>
[src]
impl<const L: Unit, const R: Unit> Div<Quantity<R>> for Quantity<L> where
Quantity<{ L.div(R) }>: ,
[src]
Quantity<{ L.div(R) }>: ,
type Output = Quantity<{ L.div(R) }>
The resulting type after applying the /
operator.
pub fn div(self, rhs: Quantity<R>) -> Self::Output
[src]
Divides two units and their values.
impl<const U: Unit> Div<Quantity<U>> for f64 where
Quantity<{ U.inv() }>: ,
[src]
Quantity<{ U.inv() }>: ,
type Output = Quantity<{ U.inv() }>
The resulting type after applying the /
operator.
pub fn div(self, rhs: Quantity<U>) -> Self::Output
[src]
impl<const U: Unit> Div<f64> for Quantity<U>
[src]
type Output = Self
The resulting type after applying the /
operator.
pub fn div(self, rhs: f64) -> Self::Output
[src]
Divides the value of this unit with a number.
impl<const U: Unit> DivAssign<f64> for Quantity<U>
[src]
pub fn div_assign(&mut self, rhs: f64)
[src]
Divides the value of this unit with a number.
impl<const L: Unit, const R: Unit> Mul<Quantity<R>> for Quantity<L> where
Quantity<{ L.mul(R) }>: ,
[src]
Quantity<{ L.mul(R) }>: ,
type Output = Quantity<{ L.mul(R) }>
The resulting type after applying the *
operator.
pub fn mul(self, rhs: Quantity<R>) -> Self::Output
[src]
Multiply two units and their values
impl<const U: Unit> Mul<Quantity<U>> for f64
[src]
type Output = Quantity<U>
The resulting type after applying the *
operator.
pub fn mul(self, rhs: Quantity<U>) -> Self::Output
[src]
Multiply the value of this unit with a number.
impl<const U: Unit> Mul<f64> for Quantity<U>
[src]
type Output = Self
The resulting type after applying the *
operator.
pub fn mul(self, rhs: f64) -> Self::Output
[src]
Multiply the value of this unit with a number.
impl<const U: Unit> MulAssign<f64> for Quantity<U>
[src]
pub fn mul_assign(&mut self, rhs: f64)
[src]
Multiply the value of this unit with a number.
impl<const U: Unit> PartialEq<Quantity<U>> for Quantity<U>
[src]
pub fn eq(&self, other: &Quantity<U>) -> bool
[src]
pub fn ne(&self, other: &Quantity<U>) -> bool
[src]
impl<const U: Unit> StructuralPartialEq for Quantity<U>
[src]
impl<const U: Unit> Sub<Quantity<U>> for Quantity<U>
[src]
type Output = Self
The resulting type after applying the -
operator.
pub fn sub(self, rhs: Self) -> Self::Output
[src]
Subtract the value of two equal units.
impl<const U: Unit> SubAssign<Quantity<U>> for Quantity<U>
[src]
pub fn sub_assign(&mut self, rhs: Self)
[src]
Subtract the value of two equal units.
Auto Trait Implementations
impl<const U: Unit> RefUnwindSafe for Quantity<U>
impl<const U: Unit> Send for Quantity<U>
impl<const U: Unit> Sync for Quantity<U>
impl<const U: Unit> Unpin for Quantity<U>
impl<const U: Unit> UnwindSafe for Quantity<U>
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,
pub 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.
pub fn to_owned(&self) -> T
[src]
pub 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.
pub 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>,