pub struct ConservationMonitor { /* private fields */ }Expand description
Monitors conservation of tracked quantities across kernel boundaries.
Implementations§
Source§impl ConservationMonitor
impl ConservationMonitor
Sourcepub fn snapshot(
&mut self,
law: ConservationLaw,
label: impl Into<String>,
value: f64,
)
pub fn snapshot( &mut self, law: ConservationLaw, label: impl Into<String>, value: f64, )
Record a quantity before kernel execution.
Sourcepub fn verify(
&mut self,
law: &ConservationLaw,
label: &str,
after_value: f64,
) -> Option<VerificationResult>
pub fn verify( &mut self, law: &ConservationLaw, label: &str, after_value: f64, ) -> Option<VerificationResult>
Verify a previously-snapshotted quantity after kernel execution.
Returns None if no matching snapshot exists.
Sourcepub fn verify_all<F>(&mut self, after_fn: F) -> Vec<VerificationResult>
pub fn verify_all<F>(&mut self, after_fn: F) -> Vec<VerificationResult>
Verify all remaining snapshots against a closure that provides the “after” value.
Sourcepub fn results(&self) -> &[VerificationResult]
pub fn results(&self) -> &[VerificationResult]
Return all verification results collected so far.
Trait Implementations§
Source§impl Clone for ConservationMonitor
impl Clone for ConservationMonitor
Source§fn clone(&self) -> ConservationMonitor
fn clone(&self) -> ConservationMonitor
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ConservationMonitor
impl RefUnwindSafe for ConservationMonitor
impl Send for ConservationMonitor
impl Sync for ConservationMonitor
impl Unpin for ConservationMonitor
impl UnsafeUnpin for ConservationMonitor
impl UnwindSafe for ConservationMonitor
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