pub struct Reading {
pub domain: String,
pub label: String,
pub value: f64,
pub unit: &'static str,
}Expand description
One named scalar from one domain at one instant.
Deliberately flat and owned: it crosses a layer boundary, gets written to a CSV column and a chart legend, and neither of those wants a borrow into a running simulation.
Fields§
§domain: StringWhich domain it came from. Filled in by the domain, because only it knows its own name.
label: StringWhat it is — "mean", "peak", "reserve", a node’s name.
value: f64The value, in SI, with one exception this workspace has already made everywhere else: temperatures are celsius, because that is the unit a column of them is read in.
unit: &'static strThe unit, for a header row or an axis. &'static str because a unit is a compile-time
fact about the quantity, not data — unlike a domain’s name, which comes from a file.
Implementations§
Trait Implementations§
impl StructuralPartialEq for Reading
Auto Trait Implementations§
impl Freeze for Reading
impl RefUnwindSafe for Reading
impl Send for Reading
impl Sync for Reading
impl Unpin for Reading
impl UnsafeUnpin for Reading
impl UnwindSafe for Reading
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