pub struct Quantity<F, U> { /* private fields */ }Expand description
Representation of a value with a corresponding unit.
Contents
Implementations§
source§impl<F, U: Unit> Quantity<F, U>
impl<F, U: Unit> Quantity<F, U>
sourcepub fn has_unit<F2>(&self, other: &Quantity<F2, U>) -> bool
pub fn has_unit<F2>(&self, other: &Quantity<F2, U>) -> bool
Check if the quantity has the same unit as the argument.
Example
let p = 5.0 * NEWTON/METER.powi(2);
assert!(p.has_unit(&BAR));sourcepub fn value(&self) -> Result<&F, QuantityError>
pub fn value(&self) -> Result<&F, QuantityError>
Return a reference to its value if the quantity is dimensionless.
Example
let p1 = 5.0 * PASCAL;
let p2 = 2.5 * PASCAL;
let ratio = p1 / p2;
assert_relative_eq!(ratio.value()?, &2.0);sourcepub fn into_value(self) -> Result<F, QuantityError>
pub fn into_value(self) -> Result<F, QuantityError>
Converts to its value if the quantity is dimensionless.
Example
let p1 = 5.0 * PASCAL;
let p2 = 2.5 * PASCAL;
let ratio = p1 / p2;
assert_relative_eq!(ratio.into_value()?, 2.0);sourcepub fn to_reduced<'a>(
&'a self,
reference: QuantityScalar<U>
) -> Result<F, QuantityError>where
&'a Self: Div<QuantityScalar<U>, Output = Self>,
pub fn to_reduced<'a>(
&'a self,
reference: QuantityScalar<U>
) -> Result<F, QuantityError>where
&'a Self: Div<QuantityScalar<U>, Output = Self>,
Returns the value of self in a given unit if possible.
Example
let p = 5.0 * BAR;
assert_relative_eq!(p.to_reduced(PASCAL)?, 500000.0);source§impl<U: Unit> Quantity<f64, U>
impl<U: Unit> Quantity<f64, U>
sourcepub fn powi(&self, i: i32) -> Self
pub fn powi(&self, i: i32) -> Self
Calculate the integer power of self.
Example
let x = 5.0 * METER;
assert_relative_eq!(x.powi(2), &(25.0 * METER * METER));sourcepub fn sqrt(&self) -> Result<Self, QuantityError>
pub fn sqrt(&self) -> Result<Self, QuantityError>
Try to calculate the square root of self.
Example
let x = 25.0 * METER * METER;
assert_relative_eq!(x.sqrt()?, &(5.0 * METER));
assert!(METER.sqrt().is_err());sourcepub fn cbrt(&self) -> Result<Self, QuantityError>
pub fn cbrt(&self) -> Result<Self, QuantityError>
Try to calculate the cubic root of self.
Example
let x = 125.0 * METER * METER * METER;
assert_relative_eq!(x.cbrt()?, &(5.0 * METER));
assert!(METER.cbrt().is_err());sourcepub fn root(&self, i: i32) -> Result<Self, QuantityError>
pub fn root(&self, i: i32) -> Result<Self, QuantityError>
Try to calculate the integer root of self.
Example
let x = 625.0 * METER * METER * METER * METER;
assert_relative_eq!(x.root(4)?, &(5.0 * METER));
assert!(METER.root(4).is_err());sourcepub fn max(&self, other: Self) -> Result<Self, QuantityError>where
U: PartialEq + Clone,
pub fn max(&self, other: Self) -> Result<Self, QuantityError>where
U: PartialEq + Clone,
Return the maximum of self and other if they have the same unit.
Example
let p1 = 110.0 * KILO * PASCAL;
let p2 = BAR;
assert_relative_eq!(p1.max(p2)?, &p1);
assert!(BAR.max(KELVIN).is_err());sourcepub fn min(&self, other: Self) -> Result<Self, QuantityError>where
U: PartialEq + Clone,
pub fn min(&self, other: Self) -> Result<Self, QuantityError>where
U: PartialEq + Clone,
Return the minimum of self and other if they have the same unit.
Example
let p1 = 110.0 * KILO * PASCAL;
let p2 = BAR;
assert_relative_eq!(p1.min(p2)?, &p2);
assert!(BAR.min(KELVIN).is_err());sourcepub fn abs(&self) -> Selfwhere
U: Clone,
pub fn abs(&self) -> Selfwhere
U: Clone,
Return the absolute value of self.
Example
let t = -50.0 * KELVIN;
assert_relative_eq!(t.abs(), &(50.0 * KELVIN));sourcepub fn signum(&self) -> f64
pub fn signum(&self) -> f64
Returns a number that represents the sign of self.
1.0if the number is positive,+0.0orINFINITY-1.0if the number is negative,-0.0orNEG_INFINITYNANif the number isNAN
sourcepub fn is_sign_positive(&self) -> bool
pub fn is_sign_positive(&self) -> bool
Returns true if self has a positive sign, including +0.0, NaNs with
positive sign bit and positive infinity.
sourcepub fn is_sign_negative(&self) -> bool
pub fn is_sign_negative(&self) -> bool
Returns true if self has a negative sign, including -0.0, NaNs with
negative sign bit and negative infinity.
source§impl<U: Unit, D: Dimension, S: Data<Elem = f64>> Quantity<ArrayBase<S, D>, U>
impl<U: Unit, D: Dimension, S: Data<Elem = f64>> Quantity<ArrayBase<S, D>, U>
sourcepub fn sum(&self) -> QuantityScalar<U>
pub fn sum(&self) -> QuantityScalar<U>
Return the sum of all elements in the array.
Example
let x = arr1(&[1.5, 2.5]) * BAR;
assert_relative_eq!(x.sum(), &(4.0 * BAR));sourcepub fn to_owned(&self) -> QuantityArray<U, D>
pub fn to_owned(&self) -> QuantityArray<U, D>
Return an uniquely owned copy of the array.
sourcepub fn get<I: NdIndex<D>>(&self, index: I) -> QuantityScalar<U>
pub fn get<I: NdIndex<D>>(&self, index: I) -> QuantityScalar<U>
Return the element at index.
The Index trait can not be implemented, because a new instance has to be created,
when indexing a quantity array. This serves as replacement for it.
sourcepub fn try_set<I: NdIndex<D>>(
&mut self,
index: I,
scalar: QuantityScalar<U>
) -> Result<(), QuantityError>where
S: DataMut,
pub fn try_set<I: NdIndex<D>>(
&mut self,
index: I,
scalar: QuantityScalar<U>
) -> Result<(), QuantityError>where
S: DataMut,
Set the element at index to scalar if scalar has the same unit as self.
sourcepub fn index_axis(
&self,
axis: Axis,
index: usize
) -> Quantity<ArrayView<'_, f64, D::Smaller>, U>where
D: RemoveAxis,
pub fn index_axis(
&self,
axis: Axis,
index: usize
) -> Quantity<ArrayView<'_, f64, D::Smaller>, U>where
D: RemoveAxis,
Returns a view restricted to index along the axis, with the axis removed.
sourcepub fn insert_axis(self, axis: Axis) -> Quantity<ArrayBase<S, D::Larger>, U>
pub fn insert_axis(self, axis: Axis) -> Quantity<ArrayBase<S, D::Larger>, U>
Insert new array axis at axis and return the result.
sourcepub fn sum_axis(&self, axis: Axis) -> Quantity<Array<f64, D::Smaller>, U>where
D: RemoveAxis,
pub fn sum_axis(&self, axis: Axis) -> Quantity<Array<f64, D::Smaller>, U>where
D: RemoveAxis,
Return sum along axis.
sourcepub fn to_vec(&self) -> Vec<QuantityScalar<U>> ⓘ
pub fn to_vec(&self) -> Vec<QuantityScalar<U>> ⓘ
Return a vector of scalar quantities for each element of self.
sourcepub fn from_shape_fn<Sh, F>(shape: Sh, f: F) -> QuantityArray<U, D>where
Sh: ShapeBuilder<Dim = D>,
F: FnMut(D::Pattern) -> QuantityScalar<U>,
pub fn from_shape_fn<Sh, F>(shape: Sh, f: F) -> QuantityArray<U, D>where
Sh: ShapeBuilder<Dim = D>,
F: FnMut(D::Pattern) -> QuantityScalar<U>,
Create an array with values created by the function f.
sourcepub fn powi(&self, i: i32) -> QuantityArray<U, D>
pub fn powi(&self, i: i32) -> QuantityArray<U, D>
Calculate the integer power of self.
Example
let x = arr1(&[3.0, 5.0]) * METER;
assert_relative_eq!(x.powi(2), &(arr1(&[9.0, 25.0]) * METER * METER));sourcepub fn sqrt(&self) -> Result<QuantityArray<U, D>, QuantityError>
pub fn sqrt(&self) -> Result<QuantityArray<U, D>, QuantityError>
Try to calculate the square root of self.
Example
let x = arr1(&[9.0, 25.0]) * METER * METER;
assert_relative_eq!(x.sqrt()?, &(arr1(&[3.0, 5.0]) * METER));sourcepub fn cbrt(&self) -> Result<QuantityArray<U, D>, QuantityError>
pub fn cbrt(&self) -> Result<QuantityArray<U, D>, QuantityError>
Try to calculate the cubic root of self.
Example
let x = arr1(&[27.0, 125.0]) * METER * METER * METER;
assert_relative_eq!(x.cbrt()?, &(arr1(&[3.0, 5.0]) * METER));sourcepub fn root(&self, i: i32) -> Result<QuantityArray<U, D>, QuantityError>
pub fn root(&self, i: i32) -> Result<QuantityArray<U, D>, QuantityError>
Try to calculate the integer root of self.
Example
let x = arr1(&[81.0, 625.0]) * METER * METER * METER * METER;
assert_relative_eq!(x.root(4)?, &(arr1(&[3.0, 5.0]) * METER));source§impl<U: Unit> Quantity<ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>, U>
impl<U: Unit> Quantity<ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>, U>
sourcepub fn linspace(
start: QuantityScalar<U>,
end: QuantityScalar<U>,
n: usize
) -> Result<Self, QuantityError>
pub fn linspace(
start: QuantityScalar<U>,
end: QuantityScalar<U>,
n: usize
) -> Result<Self, QuantityError>
Create a one-dimensional array with n evenly spaced elements from start to end (inclusive) if start and end have the same unit.
Example
let x = SIArray1::linspace(1.0 * METER, 3.0 * METER, 5)?;
assert_relative_eq!(x, &(arr1(&[1.0, 1.5, 2.0, 2.5, 3.0]) * METER));sourcepub fn logspace(
start: QuantityScalar<U>,
end: QuantityScalar<U>,
n: usize
) -> Result<Self, QuantityError>
pub fn logspace(
start: QuantityScalar<U>,
end: QuantityScalar<U>,
n: usize
) -> Result<Self, QuantityError>
Create a one-dimensional array with n logarithmically spaced elements from start to end (inclusive) if start and end have the same unit.
Example
let x = SIArray1::logspace(1.0 * METER, 16.0 * METER, 5)?;
assert_relative_eq!(x, &(arr1(&[1.0, 2.0, 4.0, 8.0, 16.0]) * METER));sourcepub fn from_vec(vec: Vec<QuantityScalar<U>>) -> Self
pub fn from_vec(vec: Vec<QuantityScalar<U>>) -> Self
Create a one-dimensional array from a vector of scalar quantities.
Trait Implementations§
source§impl<F: AbsDiffEq, U: PartialEq + Display> AbsDiffEq<Quantity<F, U>> for Quantity<F, U>
impl<F: AbsDiffEq, U: PartialEq + Display> AbsDiffEq<Quantity<F, U>> for Quantity<F, U>
source§fn default_epsilon() -> Self::Epsilon
fn default_epsilon() -> Self::Epsilon
source§fn abs_diff_eq(&self, other: &Self, epsilon: Self::Epsilon) -> bool
fn abs_diff_eq(&self, other: &Self, epsilon: Self::Epsilon) -> bool
source§fn abs_diff_ne(&self, other: &Rhs, epsilon: Self::Epsilon) -> bool
fn abs_diff_ne(&self, other: &Rhs, epsilon: Self::Epsilon) -> bool
AbsDiffEq::abs_diff_eq.source§impl<'a, F, F2, U> Add<&'a Quantity<F2, U>> for Quantity<F, U>where
F: Add<&'a F2>,
U: PartialEq + Display,
impl<'a, F, F2, U> Add<&'a Quantity<F2, U>> for Quantity<F, U>where
F: Add<&'a F2>,
U: PartialEq + Display,
source§impl<'a, 'b, F, F2, U> Add<&'b Quantity<F2, U>> for &'a Quantity<F, U>where
&'a F: Add<&'b F2>,
U: Copy + PartialEq + Display,
impl<'a, 'b, F, F2, U> Add<&'b Quantity<F2, U>> for &'a Quantity<F, U>where
&'a F: Add<&'b F2>,
U: Copy + PartialEq + Display,
source§impl<'a, F, F2, U> Add<Quantity<F2, U>> for &'a Quantity<F, U>where
&'a F: Add<F2>,
U: Copy + PartialEq + Display,
impl<'a, F, F2, U> Add<Quantity<F2, U>> for &'a Quantity<F, U>where
&'a F: Add<F2>,
U: Copy + PartialEq + Display,
source§impl<F, F2, U> Add<Quantity<F2, U>> for Quantity<F, U>where
F: Add<F2>,
U: PartialEq + Display,
impl<F, F2, U> Add<Quantity<F2, U>> for Quantity<F, U>where
F: Add<F2>,
U: PartialEq + Display,
source§impl<'a, F, F2, U> AddAssign<&'a Quantity<F2, U>> for Quantity<F, U>where
F: AddAssign<&'a F2>,
U: PartialEq + Display,
impl<'a, F, F2, U> AddAssign<&'a Quantity<F2, U>> for Quantity<F, U>where
F: AddAssign<&'a F2>,
U: PartialEq + Display,
source§fn add_assign(&mut self, other: &'a Quantity<F2, U>)
fn add_assign(&mut self, other: &'a Quantity<F2, U>)
+= operation. Read moresource§impl<F, F2, U> AddAssign<Quantity<F2, U>> for Quantity<F, U>where
F: AddAssign<F2>,
U: PartialEq + Display,
impl<F, F2, U> AddAssign<Quantity<F2, U>> for Quantity<F, U>where
F: AddAssign<F2>,
U: PartialEq + Display,
source§fn add_assign(&mut self, other: Quantity<F2, U>)
fn add_assign(&mut self, other: Quantity<F2, U>)
+= operation. Read moresource§impl<'de, F, U> Deserialize<'de> for Quantity<F, U>where
F: Deserialize<'de>,
U: Deserialize<'de>,
impl<'de, F, U> Deserialize<'de> for Quantity<F, U>where
F: Deserialize<'de>,
U: Deserialize<'de>,
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl<'a, F, U, S: RawData, D> Div<&'a ArrayBase<S, D>> for Quantity<F, U>where
F: Div<&'a ArrayBase<S, D>>,
impl<'a, F, U, S: RawData, D> Div<&'a ArrayBase<S, D>> for Quantity<F, U>where
F: Div<&'a ArrayBase<S, D>>,
source§impl<'a, F, F2, U> Div<&'a Quantity<F2, U>> for Quantity<F, U>where
F: Div<&'a F2>,
U: Div<Output = U> + Copy,
impl<'a, F, F2, U> Div<&'a Quantity<F2, U>> for Quantity<F, U>where
F: Div<&'a F2>,
U: Div<Output = U> + Copy,
source§impl<'a, 'b, F, F2, U> Div<&'b Quantity<F2, U>> for &'a Quantity<F, U>where
&'a F: Div<&'b F2>,
U: Div<Output = U> + Copy,
impl<'a, 'b, F, F2, U> Div<&'b Quantity<F2, U>> for &'a Quantity<F, U>where
&'a F: Div<&'b F2>,
U: Div<Output = U> + Copy,
source§impl<F, U, S: RawData, D> Div<ArrayBase<S, D>> for Quantity<F, U>where
F: Div<ArrayBase<S, D>>,
impl<F, U, S: RawData, D> Div<ArrayBase<S, D>> for Quantity<F, U>where
F: Div<ArrayBase<S, D>>,
source§impl<'a, F, U, S: RawData, D> Div<Quantity<F, U>> for &'a ArrayBase<S, D>where
&'a ArrayBase<S, D>: Div<F>,
U: Unit,
impl<'a, F, U, S: RawData, D> Div<Quantity<F, U>> for &'a ArrayBase<S, D>where
&'a ArrayBase<S, D>: Div<F>,
U: Unit,
source§impl<F, U, S: RawData, D> Div<Quantity<F, U>> for ArrayBase<S, D>where
ArrayBase<S, D>: Div<F>,
U: Unit,
impl<F, U, S: RawData, D> Div<Quantity<F, U>> for ArrayBase<S, D>where
ArrayBase<S, D>: Div<F>,
U: Unit,
source§impl<'a, F, F2, U> Div<Quantity<F2, U>> for &'a Quantity<F, U>where
&'a F: Div<F2>,
U: Div<Output = U> + Copy,
impl<'a, F, F2, U> Div<Quantity<F2, U>> for &'a Quantity<F, U>where
&'a F: Div<F2>,
U: Div<Output = U> + Copy,
source§impl<'a, F, F2, U> DivAssign<&'a Quantity<F2, U>> for Quantity<F, U>where
F: DivAssign<&'a F2>,
U: DivAssign + Copy,
impl<'a, F, F2, U> DivAssign<&'a Quantity<F2, U>> for Quantity<F, U>where
F: DivAssign<&'a F2>,
U: DivAssign + Copy,
source§fn div_assign(&mut self, other: &'a Quantity<F2, U>)
fn div_assign(&mut self, other: &'a Quantity<F2, U>)
/= operation. Read moresource§impl<F, F2, U> DivAssign<Quantity<F2, U>> for Quantity<F, U>where
F: DivAssign<F2>,
U: DivAssign,
impl<F, F2, U> DivAssign<Quantity<F2, U>> for Quantity<F, U>where
F: DivAssign<F2>,
U: DivAssign,
source§fn div_assign(&mut self, other: Quantity<F2, U>)
fn div_assign(&mut self, other: Quantity<F2, U>)
/= operation. Read moresource§impl<U: Unit> FromIterator<Quantity<f64, U>> for QuantityArray1<U>
impl<U: Unit> FromIterator<Quantity<f64, U>> for QuantityArray1<U>
source§fn from_iter<I>(iter: I) -> Selfwhere
I: IntoIterator<Item = QuantityScalar<U>>,
fn from_iter<I>(iter: I) -> Selfwhere
I: IntoIterator<Item = QuantityScalar<U>>,
source§impl<'a, F, U: Copy> IntoIterator for &'a Quantity<F, U>where
&'a F: IntoIterator<Item = &'a f64>,
impl<'a, F, U: Copy> IntoIterator for &'a Quantity<F, U>where
&'a F: IntoIterator<Item = &'a f64>,
source§impl<'a, F, U, S: RawData, D> Mul<&'a ArrayBase<S, D>> for Quantity<F, U>where
F: Mul<&'a ArrayBase<S, D>>,
impl<'a, F, U, S: RawData, D> Mul<&'a ArrayBase<S, D>> for Quantity<F, U>where
F: Mul<&'a ArrayBase<S, D>>,
source§impl<'a, F, F2, U> Mul<&'a Quantity<F2, U>> for Quantity<F, U>where
F: Mul<&'a F2>,
U: Mul<Output = U> + Copy,
impl<'a, F, F2, U> Mul<&'a Quantity<F2, U>> for Quantity<F, U>where
F: Mul<&'a F2>,
U: Mul<Output = U> + Copy,
source§impl<'a, 'b, F, F2, U> Mul<&'b Quantity<F2, U>> for &'a Quantity<F, U>where
&'a F: Mul<&'b F2>,
U: Mul<Output = U> + Copy,
impl<'a, 'b, F, F2, U> Mul<&'b Quantity<F2, U>> for &'a Quantity<F, U>where
&'a F: Mul<&'b F2>,
U: Mul<Output = U> + Copy,
source§impl<F, U, S: RawData, D> Mul<ArrayBase<S, D>> for Quantity<F, U>where
F: Mul<ArrayBase<S, D>>,
impl<F, U, S: RawData, D> Mul<ArrayBase<S, D>> for Quantity<F, U>where
F: Mul<ArrayBase<S, D>>,
source§impl<'a, F, U, S: RawData, D> Mul<Quantity<F, U>> for &'a ArrayBase<S, D>where
&'a ArrayBase<S, D>: Mul<F>,
U: Unit,
impl<'a, F, U, S: RawData, D> Mul<Quantity<F, U>> for &'a ArrayBase<S, D>where
&'a ArrayBase<S, D>: Mul<F>,
U: Unit,
source§impl<F, U, S: RawData, D> Mul<Quantity<F, U>> for ArrayBase<S, D>where
ArrayBase<S, D>: Mul<F>,
U: Unit,
impl<F, U, S: RawData, D> Mul<Quantity<F, U>> for ArrayBase<S, D>where
ArrayBase<S, D>: Mul<F>,
U: Unit,
source§impl<'a, F, F2, U> Mul<Quantity<F2, U>> for &'a Quantity<F, U>where
&'a F: Mul<F2>,
U: Mul<Output = U> + Copy,
impl<'a, F, F2, U> Mul<Quantity<F2, U>> for &'a Quantity<F, U>where
&'a F: Mul<F2>,
U: Mul<Output = U> + Copy,
source§impl<'a, F, F2, U> MulAssign<&'a Quantity<F2, U>> for Quantity<F, U>where
F: MulAssign<&'a F2>,
U: MulAssign + Copy,
impl<'a, F, F2, U> MulAssign<&'a Quantity<F2, U>> for Quantity<F, U>where
F: MulAssign<&'a F2>,
U: MulAssign + Copy,
source§fn mul_assign(&mut self, other: &'a Quantity<F2, U>)
fn mul_assign(&mut self, other: &'a Quantity<F2, U>)
*= operation. Read moresource§impl<F, F2, U> MulAssign<Quantity<F2, U>> for Quantity<F, U>where
F: MulAssign<F2>,
U: MulAssign,
impl<F, F2, U> MulAssign<Quantity<F2, U>> for Quantity<F, U>where
F: MulAssign<F2>,
U: MulAssign,
source§fn mul_assign(&mut self, other: Quantity<F2, U>)
fn mul_assign(&mut self, other: Quantity<F2, U>)
*= operation. Read moresource§impl<F: PartialEq, U: PartialEq + Display> PartialEq<Quantity<F, U>> for Quantity<F, U>
impl<F: PartialEq, U: PartialEq + Display> PartialEq<Quantity<F, U>> for Quantity<F, U>
source§impl<F: PartialOrd, U: PartialEq + Display> PartialOrd<Quantity<F, U>> for Quantity<F, U>
impl<F: PartialOrd, U: PartialEq + Display> PartialOrd<Quantity<F, U>> for Quantity<F, U>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self and other) and is used by the <=
operator. Read moresource§impl<F: RelativeEq, U: PartialEq + Display> RelativeEq<Quantity<F, U>> for Quantity<F, U>
impl<F: RelativeEq, U: PartialEq + Display> RelativeEq<Quantity<F, U>> for Quantity<F, U>
source§fn default_max_relative() -> Self::Epsilon
fn default_max_relative() -> Self::Epsilon
source§fn relative_eq(
&self,
other: &Self,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon
) -> bool
fn relative_eq(
&self,
other: &Self,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon
) -> bool
source§fn relative_ne(
&self,
other: &Rhs,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon
) -> bool
fn relative_ne(
&self,
other: &Rhs,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon
) -> bool
RelativeEq::relative_eq.source§impl<'a, F, F2, U> Sub<&'a Quantity<F2, U>> for Quantity<F, U>where
F: Sub<&'a F2>,
U: PartialEq + Display,
impl<'a, F, F2, U> Sub<&'a Quantity<F2, U>> for Quantity<F, U>where
F: Sub<&'a F2>,
U: PartialEq + Display,
source§impl<'a, 'b, F, F2, U> Sub<&'b Quantity<F2, U>> for &'a Quantity<F, U>where
&'a F: Sub<&'b F2>,
U: Copy + PartialEq + Display,
impl<'a, 'b, F, F2, U> Sub<&'b Quantity<F2, U>> for &'a Quantity<F, U>where
&'a F: Sub<&'b F2>,
U: Copy + PartialEq + Display,
source§impl<'a, F, F2, U> Sub<Quantity<F2, U>> for &'a Quantity<F, U>where
&'a F: Sub<F2>,
U: Copy + PartialEq + Display,
impl<'a, F, F2, U> Sub<Quantity<F2, U>> for &'a Quantity<F, U>where
&'a F: Sub<F2>,
U: Copy + PartialEq + Display,
source§impl<F, F2, U> Sub<Quantity<F2, U>> for Quantity<F, U>where
F: Sub<F2>,
U: PartialEq + Display,
impl<F, F2, U> Sub<Quantity<F2, U>> for Quantity<F, U>where
F: Sub<F2>,
U: PartialEq + Display,
source§impl<'a, F, F2, U> SubAssign<&'a Quantity<F2, U>> for Quantity<F, U>where
F: SubAssign<&'a F2>,
U: PartialEq + Display,
impl<'a, F, F2, U> SubAssign<&'a Quantity<F2, U>> for Quantity<F, U>where
F: SubAssign<&'a F2>,
U: PartialEq + Display,
source§fn sub_assign(&mut self, other: &'a Quantity<F2, U>)
fn sub_assign(&mut self, other: &'a Quantity<F2, U>)
-= operation. Read moresource§impl<F, F2, U> SubAssign<Quantity<F2, U>> for Quantity<F, U>where
F: SubAssign<F2>,
U: PartialEq + Display,
impl<F, F2, U> SubAssign<Quantity<F2, U>> for Quantity<F, U>where
F: SubAssign<F2>,
U: PartialEq + Display,
source§fn sub_assign(&mut self, other: Quantity<F2, U>)
fn sub_assign(&mut self, other: Quantity<F2, U>)
-= operation. Read more