pub struct Violation {
pub quantity: String,
pub site: String,
pub before: f64,
pub after: f64,
pub scale: f64,
pub tolerance: f64,
}Expand description
A conservation law that did not hold.
Fields§
§quantity: StringWhich law: one of quantity, or a domain’s own name for it.
site: StringWhere it broke — a domain name, a coupling name, a wavelength.
before: f64What the quantity was, in SI base units.
after: f64What it became.
scale: f64What the discrepancy was measured against — the largest entry that went into the books, not the net total, since a correct system’s net is often zero. Zero means “use the totals”, which is what a non-conservation error does.
tolerance: f64The tolerance that was being applied, so the report says how badly.
Implementations§
Source§impl Violation
impl Violation
Sourcepub fn at(
site: impl Into<String>,
quantity: impl Into<String>,
detail: f64,
) -> Violation
pub fn at( site: impl Into<String>, quantity: impl Into<String>, detail: f64, ) -> Violation
For the cases that are not a before/after comparison at all: a surface specified to reflect more than it receives, an iteration that never converged.
Sourcepub fn relative_error(&self) -> f64
pub fn relative_error(&self) -> f64
Discrepancy as a fraction of the scale it was judged against.
Trait Implementations§
Source§impl Error for Violation
impl Error for Violation
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
impl StructuralPartialEq for Violation
Auto Trait Implementations§
impl Freeze for Violation
impl RefUnwindSafe for Violation
impl Send for Violation
impl Sync for Violation
impl Unpin for Violation
impl UnsafeUnpin for Violation
impl UnwindSafe for Violation
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