pub struct Finding {
pub id: String,
pub severity: SeverityClass,
pub tier: Tier,
pub confidence: f64,
pub kind: FindingKind,
pub evidence: String,
pub suggested_action: Option<String>,
}Expand description
Single unit of analysis output.
Construct via Finding::new so the severity/tier/confidence invariants
are enforced (confidence clamped to [0, 1]; severity default derived from
the kind unless overridden).
Fields§
§id: String§severity: SeverityClass§tier: Tier§confidence: f64§kind: FindingKind§evidence: String§suggested_action: Option<String>Implementations§
Source§impl Finding
impl Finding
pub fn new( id: impl Into<String>, tier: Tier, confidence: f64, kind: FindingKind, evidence: impl Into<String>, ) -> Self
Sourcepub fn content_id(&self) -> String
pub fn content_id(&self) -> String
Stable, deterministic ID derived from the finding’s content. Same
finding across two runs produces the same ID — this is what lets
impact_explain round-trip. Call after the finding’s final
kind/evidence are set but before the ID is assigned.
Hash inputs: kind tag + evidence + the kind payload (formatted via
{:?} on the serde-derived Debug). DefaultHasher is non-
cryptographic but that’s fine — we’re deduping, not proving
non-existence.
pub fn with_severity(self, severity: SeverityClass) -> Self
pub fn with_suggested_action(self, action: impl Into<String>) -> Self
Sourcepub fn primary_path(&self) -> Option<&Path>
pub fn primary_path(&self) -> Option<&Path>
Delegates to FindingKind::primary_path. Convenience shortcut
so callers don’t have to reach through .kind for a near-ubiquitous
operation.