pub struct PowerEnvelope {
pub id: Id,
pub commodity_quantity: CommodityQuantity,
pub power_envelope_elements: Vec<PowerEnvelopeElement>,
}Expand description
A sequence of steps bounding one commodity quantity over time.
Fields§
§id: IdUnique within the Resource Manager for the session.
commodity_quantity: CommodityQuantityWhich quantity this envelope bounds.
power_envelope_elements: Vec<PowerEnvelopeElement>The steps, in chronological order.
Implementations§
Source§impl PowerEnvelope
impl PowerEnvelope
Sourcepub fn builder() -> PowerEnvelopeBuilder
pub fn builder() -> PowerEnvelopeBuilder
Create an instance of PowerEnvelope using the builder syntax
Source§impl PowerEnvelope
impl PowerEnvelope
Sourcepub fn total_duration(&self) -> Duration
pub fn total_duration(&self) -> Duration
The total time the envelope covers.
Sourcepub fn element_at(&self, offset: Duration) -> Option<&PowerEnvelopeElement>
pub fn element_at(&self, offset: Duration) -> Option<&PowerEnvelopeElement>
The step in force offset after the envelope’s start.
None once the envelope has run out — at which point the Resource Manager is
unbounded again, which is why this is an Option rather than a clamped edge.
Trait Implementations§
Source§impl Clone for PowerEnvelope
impl Clone for PowerEnvelope
Source§impl Debug for PowerEnvelope
impl Debug for PowerEnvelope
Source§impl<'de> Deserialize<'de> for PowerEnvelope
impl<'de> Deserialize<'de> for PowerEnvelope
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 PartialEq for PowerEnvelope
impl PartialEq for PowerEnvelope
Source§impl Serialize for PowerEnvelope
impl Serialize for PowerEnvelope
impl StructuralPartialEq for PowerEnvelope
Auto Trait Implementations§
impl Forget for PowerEnvelope
impl Freeze for PowerEnvelope
impl Move for PowerEnvelope
impl RefUnwindSafe for PowerEnvelope
impl Send for PowerEnvelope
impl Sync for PowerEnvelope
impl Unpin for PowerEnvelope
impl UnsafeUnpin for PowerEnvelope
impl UnwindSafe for PowerEnvelope
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