#[non_exhaustive]pub struct GateResult {
pub verdict: Verdict,
pub scope: PolicyScope,
pub evidence: Evidence,
pub checks: Vec<Check>,
pub baseline: Option<BaselineComparison>,
pub baseline_missing: bool,
pub generator: Option<ReportGenerator>,
pub source_identity: Option<SourceIdentity>,
}Expand description
The structured result of evaluating a QualityPolicy.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.verdict: VerdictThe overall outcome.
scope: PolicyScopeThe scope every requirement was evaluated under.
evidence: EvidenceWhether the scan itself covered the whole source. A single check’s evidence can be weaker still, when its metric came from a retained sample of the scanned rows.
checks: Vec<Check>Every requirement, in evaluation order.
baseline: Option<BaselineComparison>The reports compared, when the policy was evaluated against a baseline. Absent otherwise.
baseline_missing: boolThis run explicitly allowed a missing baseline and used none.
generator: Option<ReportGenerator>The build that wrote the report evaluated, which decided the metrics
the verdict reads. None (serialized as null) when the report did
not record one. The build evaluating the policy can be another.
source_identity: Option<SourceIdentity>The caller’s version of the source the report describes, None
(serialized as null) when none was recorded.
Implementations§
Source§impl GateResult
impl GateResult
Sourcepub fn passed(&self) -> bool
pub fn passed(&self) -> bool
True only for Verdict::Pass.
An inconclusive result is not a pass: reading it as one is the mistake
this API exists to prevent. Callers that need to tell “violated” from
“could not tell” should match on GateResult::verdict.
Sourcepub fn violations(&self) -> impl Iterator<Item = &Check>
pub fn violations(&self) -> impl Iterator<Item = &Check>
The checks that were evaluated and violated.
Sourcepub fn unevaluated(&self) -> impl Iterator<Item = &Check>
pub fn unevaluated(&self) -> impl Iterator<Item = &Check>
The checks that could not be evaluated.