#[non_exhaustive]pub struct MetricThresholdViolation {
pub subject: MetricSubject,
pub metric_name: String,
pub value: f64,
pub threshold: f64,
pub comparison: MetricComparison,
}Expand description
One metric value that did not meet its numeric threshold.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.subject: MetricSubjectThe complete metric subject evidence.
metric_name: StringThe stable built-in or user-defined metric name.
value: f64The measured value.
threshold: f64The required finite threshold.
comparison: MetricComparisonThe comparison that was not satisfied.
Implementations§
Source§impl MetricThresholdViolation
impl MetricThresholdViolation
Sourcepub fn new(
subject: MetricSubject,
metric_name: impl Into<String>,
value: f64,
threshold: f64,
comparison: MetricComparison,
) -> Self
pub fn new( subject: MetricSubject, metric_name: impl Into<String>, value: f64, threshold: f64, comparison: MetricComparison, ) -> Self
Creates structured threshold violation data.
Sourcepub fn identifier(&self) -> &str
pub fn identifier(&self) -> &str
Returns the file path or type name identifying the rejected subject.
Trait Implementations§
Source§impl Clone for MetricThresholdViolation
impl Clone for MetricThresholdViolation
Source§fn clone(&self) -> MetricThresholdViolation
fn clone(&self) -> MetricThresholdViolation
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MetricThresholdViolation
impl Debug for MetricThresholdViolation
Source§impl From<MetricThresholdViolation> for Violation
impl From<MetricThresholdViolation> for Violation
Source§fn from(violation: MetricThresholdViolation) -> Self
fn from(violation: MetricThresholdViolation) -> Self
Converts to this type from the input type.
Source§impl PartialEq for MetricThresholdViolation
impl PartialEq for MetricThresholdViolation
impl StructuralPartialEq for MetricThresholdViolation
Auto Trait Implementations§
impl Freeze for MetricThresholdViolation
impl RefUnwindSafe for MetricThresholdViolation
impl Send for MetricThresholdViolation
impl Sync for MetricThresholdViolation
impl Unpin for MetricThresholdViolation
impl UnwindSafe for MetricThresholdViolation
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