#[non_exhaustive]pub struct MetricPredicateViolation {
pub subject: MetricSubject,
pub metric_name: String,
pub value: f64,
}Expand description
One built-in metric value that did not satisfy a user predicate.
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 file, type, or distance subject evidence.
metric_name: StringThe stable built-in metric name.
value: f64The value rejected by the predicate.
Implementations§
Source§impl MetricPredicateViolation
impl MetricPredicateViolation
Sourcepub fn new(
subject: MetricSubject,
metric_name: impl Into<String>,
value: f64,
) -> Self
pub fn new( subject: MetricSubject, metric_name: impl Into<String>, value: f64, ) -> Self
Creates structured predicate 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 MetricPredicateViolation
impl Clone for MetricPredicateViolation
Source§fn clone(&self) -> MetricPredicateViolation
fn clone(&self) -> MetricPredicateViolation
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 MetricPredicateViolation
impl Debug for MetricPredicateViolation
Source§impl From<MetricPredicateViolation> for Violation
impl From<MetricPredicateViolation> for Violation
Source§fn from(violation: MetricPredicateViolation) -> Self
fn from(violation: MetricPredicateViolation) -> Self
Converts to this type from the input type.
Source§impl PartialEq for MetricPredicateViolation
impl PartialEq for MetricPredicateViolation
impl StructuralPartialEq for MetricPredicateViolation
Auto Trait Implementations§
impl Freeze for MetricPredicateViolation
impl RefUnwindSafe for MetricPredicateViolation
impl Send for MetricPredicateViolation
impl Sync for MetricPredicateViolation
impl Unpin for MetricPredicateViolation
impl UnwindSafe for MetricPredicateViolation
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