pub struct ScanQuery<'a, K> { /* private fields */ }Expand description
Borrowed query over findings produced by a batch scan.
Queries are lazy and allocation-free until sorting or collection is explicitly requested.
Implementations§
Source§impl<'a, K> ScanQuery<'a, K>
impl<'a, K> ScanQuery<'a, K>
Sourcepub const fn severity(self, severity: Severity) -> Self
pub const fn severity(self, severity: Severity) -> Self
Restricts the query to findings with exactly severity.
This replaces any previously configured severity constraint.
Sourcepub const fn minimum_severity(self, severity: Severity) -> Self
pub const fn minimum_severity(self, severity: Severity) -> Self
Restricts the query to findings whose severity is at least severity.
Severity follows its documented natural ordering:
Info < Low < Medium < High < Critical.
This replaces any previously configured severity constraint.
Sourcepub const fn confidence(self, confidence: Confidence) -> Self
pub const fn confidence(self, confidence: Confidence) -> Self
Restricts the query to findings with exactly confidence.
This replaces any previously configured confidence constraint.
Sourcepub const fn minimum_confidence(self, confidence: Confidence) -> Self
pub const fn minimum_confidence(self, confidence: Confidence) -> Self
Restricts the query to findings whose confidence is at least
confidence.
Confidence follows its documented natural ordering:
Low < Medium < High.
This replaces any previously configured confidence constraint.
Sourcepub const fn rule_id(self, rule_id: &'a str) -> Self
pub const fn rule_id(self, rule_id: &'a str) -> Self
Restricts the query to findings produced by the exact rule identifier.
The identifier is borrowed by the query and is compared without allocation.
Sourcepub const fn high_priority(self) -> Self
pub const fn high_priority(self) -> Self
Restricts the query to high- or critical-severity findings.
Sourcepub const fn high_confidence(self) -> Self
pub const fn high_confidence(self) -> Self
Restricts the query to high-confidence findings.
Sourcepub fn iter(&self) -> impl Iterator<Item = (&'a K, &'a Finding)> + '_
pub fn iter(&self) -> impl Iterator<Item = (&'a K, &'a Finding)> + '_
Iterates over every finding while retaining its source key.
The iterator is borrowed and allocation-free. Findings are yielded in source input order and in each report’s deterministic finding order.
Sourcepub fn sort(&self, sort: ScanSort) -> SortedScanQuery<'a, K>where
K: Ord,
pub fn sort(&self, sort: ScanSort) -> SortedScanQuery<'a, K>where
K: Ord,
Materializes and sorts the findings selected by this query.
Filtering remains lazy until this method is called. Sorting allocates a
vector containing borrowed (source, finding) pairs, but it never
clones source keys or findings and never mutates the underlying
ScanResults.
Source sorting requires K: Ord. The same bound is applied to the
complete sorting API so one sort(ScanSort::...) method can cover every
supported ordering consistently.
Sourcepub fn first(&self) -> Option<(&'a K, &'a Finding)>
pub fn first(&self) -> Option<(&'a K, &'a Finding)>
Returns the first finding selected by this query, if any.
Sourcepub fn last(&self) -> Option<(&'a K, &'a Finding)>
pub fn last(&self) -> Option<(&'a K, &'a Finding)>
Returns the last finding selected by this query, if any.
The query remains allocation-free. This walks the selected findings to completion because the underlying filtered iterator is not required to be double-ended.
Sourcepub fn has_matches(&self) -> bool
pub fn has_matches(&self) -> bool
Returns true when this query selects at least one finding.
Evaluation short-circuits at the first match.