pub struct IntegrityCanaryReport {
pub score: IntegrityRiskScore,
pub policy: IntegrityCanaryPolicy,
pub findings: Vec<ProbeFinding>,
pub mitigation_hints: Vec<MitigationHint>,
pub trap_findings: Vec<ProbeFinding>,
}Expand description
Aggregate integrity canary report.
Produced by IntegrityCanaryReport::from_findings (and the
with_policy variant) and attached to
crate::diagnostic::DiagnosticReport via
crate::diagnostic::DiagnosticReport::with_integrity_canary.
Fields§
§score: IntegrityRiskScoreAggregate score and classification.
policy: IntegrityCanaryPolicyPolicy used to derive the classification. Always populated so consumers can inspect the thresholds without having to thread the policy through their own state.
findings: Vec<ProbeFinding>Individual probe findings in evaluation order.
mitigation_hints: Vec<MitigationHint>Aggregated mitigation hints (one entry per finding that
fired with a Suspected or Confirmed outcome). Surfaced
as a separate field so consumers can render hints without
re-iterating findings.
trap_findings: Vec<ProbeFinding>Trap findings (Suspected or Confirmed) only — a thin
view over findings for callers that only care about
fired traps.
Implementations§
Source§impl IntegrityCanaryReport
impl IntegrityCanaryReport
Sourcepub fn from_findings(findings: Vec<ProbeFinding>) -> Self
pub fn from_findings(findings: Vec<ProbeFinding>) -> Self
Build a report from a list of findings using the default policy.
Sourcepub fn with_policy(
findings: Vec<ProbeFinding>,
policy: IntegrityCanaryPolicy,
) -> Self
pub fn with_policy( findings: Vec<ProbeFinding>, policy: IntegrityCanaryPolicy, ) -> Self
Build a report from a list of findings + a custom policy.
Computes the aggregate score, classifies it under policy,
and populates the Self::mitigation_hints and
Self::trap_findings helper fields.
Sourcepub const fn is_confirmed(&self) -> bool
pub const fn is_confirmed(&self) -> bool
true when the aggregate classification is
IntegrityRiskClassification::Confirmed.
Sourcepub const fn has_trap_signal(&self) -> bool
pub const fn has_trap_signal(&self) -> bool
true when the aggregate classification is
IntegrityRiskClassification::Suspected or
IntegrityRiskClassification::Confirmed.
Sourcepub const fn trap_count(&self) -> usize
pub const fn trap_count(&self) -> usize
Number of findings that fired with a trap outcome.
Sourcepub fn confirmed_count(&self) -> usize
pub fn confirmed_count(&self) -> usize
Number of findings that produced a Confirmed outcome.
Trait Implementations§
Source§impl Clone for IntegrityCanaryReport
impl Clone for IntegrityCanaryReport
Source§fn clone(&self) -> IntegrityCanaryReport
fn clone(&self) -> IntegrityCanaryReport
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more