pub struct Quantity<F, U> { /* private fields */ }Expand description
Representation of a value with a corresponding unit.
Contents
Implementations
sourceimpl<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);sourceimpl<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) -> Self where
U: Clone,
pub fn abs(&self) -> Self where
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.
sourceimpl<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>>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
pub fn to_vec(&self) -> Vec<QuantityScalar<U>>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
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));sourceimpl<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
sourceimpl<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>
sourcefn default_epsilon() -> Self::Epsilon
fn default_epsilon() -> Self::Epsilon
The default tolerance to use when testing values that are close together. Read more
sourcefn abs_diff_eq(&self, other: &Self, epsilon: Self::Epsilon) -> bool
fn abs_diff_eq(&self, other: &Self, epsilon: Self::Epsilon) -> bool
A test for equality that uses the absolute difference to compute the approximate equality of two numbers. Read more
sourcefn abs_diff_ne(&self, other: &Rhs, epsilon: Self::Epsilon) -> bool
fn abs_diff_ne(&self, other: &Rhs, epsilon: Self::Epsilon) -> bool
The inverse of AbsDiffEq::abs_diff_eq.
sourceimpl<'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,
sourceimpl<'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,
sourceimpl<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,
sourceimpl<'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,
sourceimpl<'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,
sourcefn add_assign(&mut self, other: &'a Quantity<F2, U>)
fn add_assign(&mut self, other: &'a Quantity<F2, U>)
Performs the += operation. Read more
sourceimpl<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,
sourcefn add_assign(&mut self, other: Quantity<F2, U>)
fn add_assign(&mut self, other: Quantity<F2, U>)
Performs the += operation. Read more
sourceimpl<'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>,
sourcefn 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>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl<'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>>,
sourceimpl<'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,
sourceimpl<'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,
sourceimpl<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>>,
sourceimpl<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,
sourceimpl<'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,
sourceimpl<'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,
sourceimpl<'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,
sourcefn div_assign(&mut self, other: &'a Quantity<F2, U>)
fn div_assign(&mut self, other: &'a Quantity<F2, U>)
Performs the /= operation. Read more
sourceimpl<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,
sourcefn div_assign(&mut self, other: Quantity<F2, U>)
fn div_assign(&mut self, other: Quantity<F2, U>)
Performs the /= operation. Read more
sourceimpl<'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>>,
sourceimpl<'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,
sourceimpl<'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,
sourceimpl<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>>,
sourceimpl<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,
sourceimpl<'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,
sourceimpl<'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,
sourceimpl<'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,
sourcefn mul_assign(&mut self, other: &'a Quantity<F2, U>)
fn mul_assign(&mut self, other: &'a Quantity<F2, U>)
Performs the *= operation. Read more
sourceimpl<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,
sourcefn mul_assign(&mut self, other: Quantity<F2, U>)
fn mul_assign(&mut self, other: Quantity<F2, U>)
Performs the *= operation. Read more
sourceimpl<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>
sourcefn partial_cmp(&self, other: &Self) -> Option<Ordering>
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
This method returns an ordering between self and other values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
sourceimpl<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>
sourcefn default_max_relative() -> Self::Epsilon
fn default_max_relative() -> Self::Epsilon
The default relative tolerance for testing values that are far-apart. Read more
sourcefn 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
A test for equality that uses a relative comparison if the values are far apart.
sourcefn 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
The inverse of RelativeEq::relative_eq.
sourceimpl<'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,
sourceimpl<'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,
sourceimpl<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,
sourceimpl<'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,
sourceimpl<'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,
sourcefn sub_assign(&mut self, other: &'a Quantity<F2, U>)
fn sub_assign(&mut self, other: &'a Quantity<F2, U>)
Performs the -= operation. Read more
sourceimpl<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,
sourcefn sub_assign(&mut self, other: Quantity<F2, U>)
fn sub_assign(&mut self, other: Quantity<F2, U>)
Performs the -= operation. Read more
impl<F: Copy, U: Copy> Copy for Quantity<F, U>
Auto Trait Implementations
impl<F, U> RefUnwindSafe for Quantity<F, U> where
F: RefUnwindSafe,
U: RefUnwindSafe,
impl<F, U> Send for Quantity<F, U> where
F: Send,
U: Send,
impl<F, U> Sync for Quantity<F, U> where
F: Sync,
U: Sync,
impl<F, U> Unpin for Quantity<F, U> where
F: Unpin,
U: Unpin,
impl<F, U> UnwindSafe for Quantity<F, U> where
F: UnwindSafe,
U: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more