pub struct ConservedQuantity {
pub name: String,
pub values: Vec<(f64, f64)>,
pub drift_rate: f64,
}Expand description
Tracks a single conserved quantity over time.
Fields§
§name: String§values: Vec<(f64, f64)>§drift_rate: f64Implementations§
Source§impl ConservedQuantity
impl ConservedQuantity
pub fn new(name: &str) -> Self
Sourcepub fn current_drift_rate(&self) -> f64
pub fn current_drift_rate(&self) -> f64
Current drift rate.
Sourcepub fn total_drift(&self) -> f64
pub fn total_drift(&self) -> f64
Total accumulated drift from first recorded value.
Trait Implementations§
Source§impl Clone for ConservedQuantity
impl Clone for ConservedQuantity
Auto Trait Implementations§
impl Freeze for ConservedQuantity
impl RefUnwindSafe for ConservedQuantity
impl Send for ConservedQuantity
impl Sync for ConservedQuantity
impl Unpin for ConservedQuantity
impl UnsafeUnpin for ConservedQuantity
impl UnwindSafe for ConservedQuantity
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