pub struct Finding {
pub rule_id: &'static str,
pub severity: Severity,
pub title: String,
pub summary: String,
pub evidence: Vec<Evidence>,
pub confidence: Confidence,
}Expand description
One rule’s conclusion about the current state of the system (§11.1).
Fields§
§rule_id: &'static strThe stable identifier of the rule that produced this.
A &'static str rather than an enum so that rules can be registered
without every consumer needing to be recompiled against a closed set, and
so that the id can be logged and exported verbatim.
severity: SeverityHow serious this is.
title: StringA short headline, e.g. Sustained CPU saturation.
summary: StringOne or two sentences of explanation, including the counts the rule used.
Deliberately free of byte counts: the unit family is a display setting, so
byte-valued figures belong in Self::evidence where the UI can format
them (§12).
evidence: Vec<Evidence>The raw measurements the conclusion rests on (§11.3).
confidence: ConfidenceHow much the evidence actually supports the conclusion (§11.3).
Implementations§
Source§impl Finding
impl Finding
Sourcepub fn new(
rule_id: &'static str,
severity: Severity,
title: impl Into<String>,
summary: impl Into<String>,
confidence: Confidence,
) -> Self
pub fn new( rule_id: &'static str, severity: Severity, title: impl Into<String>, summary: impl Into<String>, confidence: Confidence, ) -> Self
Builds a finding with no evidence attached yet.
Sourcepub fn with_evidence(self, evidence: Vec<Evidence>) -> Self
pub fn with_evidence(self, evidence: Vec<Evidence>) -> Self
Attaches the raw evidence §11.3 requires.
Sourcepub const fn symbol(&self) -> char
pub const fn symbol(&self) -> char
The redundant non-color cue for this finding’s severity (§5.2).
Sourcepub fn headline(&self) -> String
pub fn headline(&self) -> String
The WATCH: Sustained CPU saturation line from §11.3’s example.
Sourcepub fn render_evidence(&self, units: ByteUnits) -> String
pub fn render_evidence(&self, units: ByteUnits) -> String
The Evidence: ... line from §11.3’s example.
Sourcepub fn render_confidence(&self) -> String
pub fn render_confidence(&self) -> String
The Confidence: medium. line from §11.3’s example.