pub struct Density(/* private fields */);Expand description
Implementations§
Source§impl Density
impl Density
Sourcepub const fn from_kgpm3(val: f64) -> Self
pub const fn from_kgpm3(val: f64) -> Self
Create from kilograms per cubic meter (kg/m³).
Sourcepub const fn from_gpcm3(val: f64) -> Self
pub const fn from_gpcm3(val: f64) -> Self
Create from grams per cubic centimeter (g/cm³).
Sourcepub const fn from_lbpft3(val: f64) -> Self
pub const fn from_lbpft3(val: f64) -> Self
Create from pounds per cubic foot (lb/ft³).
Sourcepub const fn display_as(self, unit: DensityUnit) -> DisplayWithUnit
pub const fn display_as(self, unit: DensityUnit) -> DisplayWithUnit
Return a display wrapper that formats this density in the given unit.
Trait Implementations§
Source§impl AddAssign for Density
impl AddAssign for Density
Source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
Performs the
+= operation. Read moreSource§impl DivAssign<f64> for Density
impl DivAssign<f64> for Density
Source§fn div_assign(&mut self, rhs: f64)
fn div_assign(&mut self, rhs: f64)
Performs the
/= operation. Read moreSource§impl MulAssign<f64> for Density
impl MulAssign<f64> for Density
Source§fn mul_assign(&mut self, rhs: f64)
fn mul_assign(&mut self, rhs: f64)
Performs the
*= operation. Read moreSource§impl PartialOrd for Density
impl PartialOrd for Density
Source§impl SubAssign for Density
impl SubAssign for Density
Source§fn sub_assign(&mut self, rhs: Self)
fn sub_assign(&mut self, rhs: Self)
Performs the
-= operation. Read moreimpl Copy for Density
impl StructuralPartialEq for Density
Auto Trait Implementations§
impl Freeze for Density
impl RefUnwindSafe for Density
impl Send for Density
impl Sync for Density
impl Unpin for Density
impl UnsafeUnpin for Density
impl UnwindSafe for Density
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more