pub struct Energy(/* private fields */);Expand description
Energy in watt-hours, load convention: positive is energy taken in.
Implementations§
Source§impl Energy
impl Energy
Sourcepub fn is_finite(self) -> bool
pub fn is_finite(self) -> bool
true when the value is finite — the precondition every setpoint
is checked against before it leaves the process.
Sourcepub fn max(self, other: Self) -> Self
pub fn max(self, other: Self) -> Self
The larger of two values. Propagates NaN rather than hiding it.
Sourcepub fn min(self, other: Self) -> Self
pub fn min(self, other: Self) -> Self
The smaller of two values. Propagates NaN rather than hiding it.
Sourcepub fn clamp(self, lo: Self, hi: Self) -> Self
pub fn clamp(self, lo: Self, hi: Self) -> Self
Clamped into [lo, hi].
§Panics
Panics when lo > hi, which is a programming error in the caller
rather than a runtime condition.
Trait Implementations§
Source§impl AddAssign for Energy
impl AddAssign for Energy
Source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
Performs the
+= operation. Read moreimpl Copy for Energy
Source§impl<'de> Deserialize<'de> for Energy
impl<'de> Deserialize<'de> for Energy
Source§fn 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
Source§impl PartialOrd for Energy
impl PartialOrd for Energy
impl StructuralPartialEq for Energy
Source§impl SubAssign for Energy
impl SubAssign for Energy
Source§fn sub_assign(&mut self, rhs: Self)
fn sub_assign(&mut self, rhs: Self)
Performs the
-= operation. Read moreAuto Trait Implementations§
impl Freeze for Energy
impl RefUnwindSafe for Energy
impl Send for Energy
impl Sync for Energy
impl Unpin for Energy
impl UnsafeUnpin for Energy
impl UnwindSafe for Energy
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