pub struct SpecificEnergy(/* private fields */);Expand description
A specific energy quantity, stored canonically in J/kg (= m²/s²).
§Construction
use space_units::SpecificEnergy;
let se = SpecificEnergy::from_km2ps2(-29.5);§Typed arithmetic
§Special methods
SpecificEnergy::sqrtreturns aVelocity(requiresstdfeature).
Implementations§
Source§impl SpecificEnergy
impl SpecificEnergy
Sourcepub const fn from_j_per_kg(val: f64) -> Self
pub const fn from_j_per_kg(val: f64) -> Self
Create from joules per kilogram (J/kg).
Sourcepub const fn from_km2ps2(val: f64) -> Self
pub const fn from_km2ps2(val: f64) -> Self
Create from km²/s² (common astrodynamics unit).
Sourcepub const fn from_kj_per_kg(val: f64) -> Self
pub const fn from_kj_per_kg(val: f64) -> Self
Create from kilojoules per kilogram (kJ/kg).
Sourcepub const fn from_mj_per_kg(val: f64) -> Self
pub const fn from_mj_per_kg(val: f64) -> Self
Create from megajoules per kilogram (MJ/kg).
Sourcepub const fn in_j_per_kg(self) -> f64
pub const fn in_j_per_kg(self) -> f64
Get value in joules per kilogram (J/kg).
Sourcepub const fn in_kj_per_kg(self) -> f64
pub const fn in_kj_per_kg(self) -> f64
Get value in kilojoules per kilogram (kJ/kg).
Sourcepub const fn in_mj_per_kg(self) -> f64
pub const fn in_mj_per_kg(self) -> f64
Get value in megajoules per kilogram (MJ/kg).
Sourcepub fn in_unit(self, unit: SpecificEnergyUnit) -> f64
pub fn in_unit(self, unit: SpecificEnergyUnit) -> f64
Get value in the specified SpecificEnergyUnit.
Sourcepub fn display_as(self, unit: SpecificEnergyUnit) -> DisplayWithUnit
pub fn display_as(self, unit: SpecificEnergyUnit) -> DisplayWithUnit
Return a display wrapper that formats this specific energy in the given unit.
Trait Implementations§
Source§impl Add for SpecificEnergy
impl Add for SpecificEnergy
Source§impl AddAssign for SpecificEnergy
impl AddAssign for SpecificEnergy
Source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
Performs the
+= operation. Read moreSource§impl Clone for SpecificEnergy
impl Clone for SpecificEnergy
Source§fn clone(&self) -> SpecificEnergy
fn clone(&self) -> SpecificEnergy
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SpecificEnergy
impl Debug for SpecificEnergy
Source§impl Default for SpecificEnergy
impl Default for SpecificEnergy
Source§fn default() -> SpecificEnergy
fn default() -> SpecificEnergy
Returns the “default value” for a type. Read more
Source§impl Display for SpecificEnergy
impl Display for SpecificEnergy
Source§impl Div<f64> for SpecificEnergy
impl Div<f64> for SpecificEnergy
Source§impl Div for SpecificEnergy
impl Div for SpecificEnergy
Source§impl DivAssign<f64> for SpecificEnergy
impl DivAssign<f64> for SpecificEnergy
Source§fn div_assign(&mut self, rhs: f64)
fn div_assign(&mut self, rhs: f64)
Performs the
/= operation. Read moreSource§impl Mul<SpecificEnergy> for f64
impl Mul<SpecificEnergy> for f64
Source§type Output = SpecificEnergy
type Output = SpecificEnergy
The resulting type after applying the
* operator.Source§fn mul(self, rhs: SpecificEnergy) -> SpecificEnergy
fn mul(self, rhs: SpecificEnergy) -> SpecificEnergy
Performs the
* operation. Read moreSource§impl Mul<f64> for SpecificEnergy
impl Mul<f64> for SpecificEnergy
Source§impl MulAssign<f64> for SpecificEnergy
impl MulAssign<f64> for SpecificEnergy
Source§fn mul_assign(&mut self, rhs: f64)
fn mul_assign(&mut self, rhs: f64)
Performs the
*= operation. Read moreSource§impl Neg for SpecificEnergy
impl Neg for SpecificEnergy
Source§impl PartialEq for SpecificEnergy
impl PartialEq for SpecificEnergy
Source§impl PartialOrd for SpecificEnergy
impl PartialOrd for SpecificEnergy
Source§impl Sub for SpecificEnergy
impl Sub for SpecificEnergy
Source§impl SubAssign for SpecificEnergy
impl SubAssign for SpecificEnergy
Source§fn sub_assign(&mut self, rhs: Self)
fn sub_assign(&mut self, rhs: Self)
Performs the
-= operation. Read moreSource§impl Sum for SpecificEnergy
impl Sum for SpecificEnergy
impl Copy for SpecificEnergy
impl StructuralPartialEq for SpecificEnergy
Auto Trait Implementations§
impl Freeze for SpecificEnergy
impl RefUnwindSafe for SpecificEnergy
impl Send for SpecificEnergy
impl Sync for SpecificEnergy
impl Unpin for SpecificEnergy
impl UnsafeUnpin for SpecificEnergy
impl UnwindSafe for SpecificEnergy
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