pub struct ConservationBudget { /* private fields */ }Expand description
Tracks cumulative conservation drift across multiple kernel executions.
Implementations§
Source§impl ConservationBudget
impl ConservationBudget
Sourcepub fn record(&mut self, result: &VerificationResult)
pub fn record(&mut self, result: &VerificationResult)
Record a verification result, accumulating drift.
Sourcepub fn record_all(&mut self, results: &[VerificationResult])
pub fn record_all(&mut self, results: &[VerificationResult])
Record multiple results at once.
Sourcepub fn drift_for(&self, law: &ConservationLaw) -> f64
pub fn drift_for(&self, law: &ConservationLaw) -> f64
Get the cumulative drift for a specific law.
Sourcepub fn total_drift(&self) -> f64
pub fn total_drift(&self) -> f64
Get the total cumulative drift across all laws.
Sourcepub fn check_alert(&self) -> Option<Alert>
pub fn check_alert(&self) -> Option<Alert>
Check whether cumulative drift exceeds the alert threshold.
Sourcepub fn verification_count(&self) -> u64
pub fn verification_count(&self) -> u64
Total number of verifications recorded.
Sourcepub fn violation_count(&self) -> u64
pub fn violation_count(&self) -> u64
Total number of violations recorded.
Sourcepub fn average_drift(&self) -> f64
pub fn average_drift(&self) -> f64
Average drift per verification.
Sourcepub fn violation_rate(&self) -> f64
pub fn violation_rate(&self) -> f64
Violation rate as a fraction (0.0 to 1.0).
Trait Implementations§
Source§impl Clone for ConservationBudget
impl Clone for ConservationBudget
Source§fn clone(&self) -> ConservationBudget
fn clone(&self) -> ConservationBudget
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 ConservationBudget
impl RefUnwindSafe for ConservationBudget
impl Send for ConservationBudget
impl Sync for ConservationBudget
impl Unpin for ConservationBudget
impl UnsafeUnpin for ConservationBudget
impl UnwindSafe for ConservationBudget
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