pub struct Energy<R>(/* private fields */)
where
R: RealField;Expand description
Energy (Joules) — SI-derived unit. Can be negative (potential wells).
Implementations§
Source§impl<R> Energy<R>where
R: RealField,
impl<R> Energy<R>where
R: RealField,
pub fn new(val: R) -> Result<Energy<R>, PhysicsError>
pub fn new_unchecked(val: R) -> Energy<R>
pub fn value(&self) -> R
Source§impl<R> Energy<R>where
R: RealField + FromPrimitive,
impl<R> Energy<R>where
R: RealField + FromPrimitive,
pub fn from_electron_volts(ev: R) -> Result<Energy<R>, PhysicsError>
pub fn from_calories(cal: R) -> Result<Energy<R>, PhysicsError>
pub fn from_kilowatt_hours(kwh: R) -> Result<Energy<R>, PhysicsError>
pub fn as_electron_volts(&self) -> R
pub fn as_calories(&self) -> R
pub fn as_kilowatt_hours(&self) -> R
Trait Implementations§
impl<R> Copy for Energy<R>
Source§impl<R> PartialOrd for Energy<R>where
R: PartialOrd + RealField,
impl<R> PartialOrd for Energy<R>where
R: PartialOrd + RealField,
impl<R> StructuralPartialEq for Energy<R>
Auto Trait Implementations§
impl<R> Freeze for Energy<R>where
R: Freeze,
impl<R> RefUnwindSafe for Energy<R>where
R: RefUnwindSafe,
impl<R> Send for Energy<R>where
R: Send,
impl<R> Sync for Energy<R>where
R: Sync,
impl<R> Unpin for Energy<R>where
R: Unpin,
impl<R> UnsafeUnpin for Energy<R>where
R: UnsafeUnpin,
impl<R> UnwindSafe for Energy<R>where
R: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more