pub struct Energy(/* private fields */);Expand description
Energy (Joules or eV).
Implementations§
Source§impl Energy
impl Energy
Sourcepub fn new(val: f64) -> Result<Self, PhysicsError>
pub fn new(val: f64) -> Result<Self, PhysicsError>
Creates a new Energy instance (Joules).
Sourcepub fn from_electron_volts(ev: f64) -> Result<Self, PhysicsError>
pub fn from_electron_volts(ev: f64) -> Result<Self, PhysicsError>
Electron Volts.
Sourcepub fn from_calories(cal: f64) -> Result<Self, PhysicsError>
pub fn from_calories(cal: f64) -> Result<Self, PhysicsError>
Calories (thermochemical).
Sourcepub fn from_kilowatt_hours(kwh: f64) -> Result<Self, PhysicsError>
pub fn from_kilowatt_hours(kwh: f64) -> Result<Self, PhysicsError>
Kilowatt-hours.
pub fn new_unchecked(val: f64) -> Self
pub fn value(&self) -> f64
Sourcepub fn as_electron_volts(&self) -> f64
pub fn as_electron_volts(&self) -> f64
As Electron Volts.
Sourcepub fn as_calories(&self) -> f64
pub fn as_calories(&self) -> f64
As Calories.
Sourcepub fn as_kilowatt_hours(&self) -> f64
pub fn as_kilowatt_hours(&self) -> f64
As Kilowatt-hours.
Trait Implementations§
Source§impl PartialOrd for Energy
impl PartialOrd for Energy
impl Copy for Energy
impl StructuralPartialEq for Energy
Auto Trait Implementations§
impl Freeze for Energy
impl RefUnwindSafe for Energy
impl Send for Energy
impl Sync for Energy
impl Unpin for Energy
impl UnwindSafe for Energy
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)