#[non_exhaustive]pub struct OperatingPointSeries {
pub time_axis: TimeAxis,
pub points: Vec<OperatingPoint>,
pub metadata: BTreeMap<String, Value>,
}Expand description
A format neutral series of operating points over a package’s static payload.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.time_axis: TimeAxisShared period count, durations, and labels.
points: Vec<OperatingPoint>Ordered operating states. Each state is addressed by its index.
metadata: BTreeMap<String, Value>Metadata from the source format, such as source_format.
Implementations§
Source§impl OperatingPointSeries
impl OperatingPointSeries
pub fn new(time_axis: TimeAxis, points: Vec<OperatingPoint>) -> Self
pub fn is_empty(&self) -> bool
Sourcepub fn point(&self, index: usize) -> Option<&OperatingPoint>
pub fn point(&self, index: usize) -> Option<&OperatingPoint>
Return the first point with index.
Use OperatingPointSeries::unique_point when duplicate indices must be
rejected instead of collapsed.
Sourcepub fn unique_point(&self, index: usize) -> Result<Option<&OperatingPoint>>
pub fn unique_point(&self, index: usize) -> Result<Option<&OperatingPoint>>
Return the only point with index, rejecting duplicate period indices.
pub fn with_metadata(self, metadata: BTreeMap<String, Value>) -> Self
Trait Implementations§
Source§impl Clone for OperatingPointSeries
impl Clone for OperatingPointSeries
Source§fn clone(&self) -> OperatingPointSeries
fn clone(&self) -> OperatingPointSeries
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 OperatingPointSeries
impl Debug for OperatingPointSeries
Source§impl Default for OperatingPointSeries
impl Default for OperatingPointSeries
Source§fn default() -> OperatingPointSeries
fn default() -> OperatingPointSeries
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for OperatingPointSeries
impl<'de> Deserialize<'de> for OperatingPointSeries
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 OperatingPointSeries
impl PartialEq for OperatingPointSeries
Source§impl Serialize for OperatingPointSeries
impl Serialize for OperatingPointSeries
impl StructuralPartialEq for OperatingPointSeries
Auto Trait Implementations§
impl Freeze for OperatingPointSeries
impl RefUnwindSafe for OperatingPointSeries
impl Send for OperatingPointSeries
impl Sync for OperatingPointSeries
impl Unpin for OperatingPointSeries
impl UnsafeUnpin for OperatingPointSeries
impl UnwindSafe for OperatingPointSeries
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