pub struct FactProvenance {
pub fact_name: &'static str,
pub key: String,
pub outcome: FactOutcome,
pub detail: Option<String>,
}Expand description
A record that a policy consulted a fact while reaching its decision.
Fact-backed policies (such as crate::RebacPolicy) attach one of these per
fact lookup to their PolicyEvalResult::Granted or
PolicyEvalResult::NotApplicable node, so a decision’s inputs are explained
alongside its outcome. Provenance is intentionally type-erased — a fact
name, a rendered key, an outcome, and optional detail — rather than the
typed crate::FactKey, so it lives on the non-generic result tree and is
straightforward to log.
Operational fact-load telemetry (latencies, batch fan-out, cache hits) is a
separate concern surfaced through tracing spans (gatehouse.fact_load);
this type is for per-decision explanation.
Fields§
§fact_name: &'static strThe crate::FactKey::NAME of the consulted fact (e.g. "relationship").
key: StringA human-readable rendering of the fact key that was looked up.
outcome: FactOutcomeHow the load resolved.
detail: Option<String>Optional extra detail, such as the backend error message when
outcome is FactOutcome::Error.
Implementations§
Trait Implementations§
Source§impl Clone for FactProvenance
impl Clone for FactProvenance
Source§fn clone(&self) -> FactProvenance
fn clone(&self) -> FactProvenance
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more