pub struct Finding { /* private fields */ }Expand description
A single detection produced by a scanner.
A finding identifies the rule that matched, the exact source location of the match, and the rule-assigned severity and confidence.
Findings do not retain or copy the matched secret. Consumers can inspect
the original source using Location::start and Location::end when
they explicitly need access to the matched span.
Implementations§
Source§impl Finding
impl Finding
Sourcepub const fn rule_id(&self) -> &RuleId
pub const fn rule_id(&self) -> &RuleId
Returns the stable identifier of the rule that produced this finding.
Sourcepub const fn location(&self) -> &Location
pub const fn location(&self) -> &Location
Returns the exact source location of the detected span.
Sourcepub const fn confidence(&self) -> Confidence
pub const fn confidence(&self) -> Confidence
Returns the confidence assigned by the matching rule.
Sourcepub const fn remediation(&self) -> Option<Remediation>
pub const fn remediation(&self) -> Option<Remediation>
Returns the recommended response to this finding, when one is known.
Sourcepub fn explanation(&self, scanner: &Scanner) -> Option<Explanation>
pub fn explanation(&self, scanner: &Scanner) -> Option<Explanation>
Resolves typed explanation facts against the scanner that produced this finding.
A finding intentionally stores no duplicate detection-mode or explanation metadata. Resolution uses the scanner’s immutable compiled rule metadata and fails closed when the finding cannot be mapped unambiguously.
This operation performs no allocation and never accesses source text or the matched sensitive value.
Sourcepub const fn is_critical(&self) -> bool
pub const fn is_critical(&self) -> bool
Returns true when this finding has critical severity.
Sourcepub const fn is_high_priority(&self) -> bool
pub const fn is_high_priority(&self) -> bool
Returns true when this finding has high or critical severity.
Sourcepub const fn is_high_confidence(&self) -> bool
pub const fn is_high_confidence(&self) -> bool
Returns true when this finding has high confidence.