pub enum CompileOutcome {
Compiled(CompiledId),
CompiledWithWarnings(CompiledId, Vec<String>),
Rejected(String),
}Expand description
What Evaluator::compile decided about one predicate document.
Three outcomes, not two, because a working compile and a working compile with something the operator should see are different enough to need different handling downstream (an operator-facing report, never a blocked policy) and collapsing them would either bury the warning or promote it to a rejection it never earned.
Variants§
Compiled(CompiledId)
predicate compiled cleanly. evaluate/observe/policy_lifecycle
calls for this policy should name this CompiledId from now on.
CompiledWithWarnings(CompiledId, Vec<String>)
predicate compiled, but the evaluator has something to say about
it that does not block it from being used – e.g. “this pattern is
vulnerable to homoglyphs, normalize first.” Reaches the operator;
never the caller’s decision to invent on the evaluator’s behalf,
since only the evaluator knows what is actually wrong with its own
compiled form.
Rejected(String)
predicate could not be compiled at all: bad syntax, an
unsupported combination, whatever this evaluator wants to say. The
caller treats this exactly like an unrecognised language
– crate::policy::Predicate::Unusable,
scoped to this policy’s own applicability – except that
didbot-pds’s loader additionally checks whether an earlier
revision of the same policy last compiled successfully, and if so
keeps enforcing that one instead. See plan/policy.md’s
last-good-revision behaviour for why a rejection here must never by
itself widen or produce a blanket denial.
Trait Implementations§
Source§impl Clone for CompileOutcome
impl Clone for CompileOutcome
Source§fn clone(&self) -> CompileOutcome
fn clone(&self) -> CompileOutcome
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CompileOutcome
impl Debug for CompileOutcome
Source§impl PartialEq for CompileOutcome
impl PartialEq for CompileOutcome
Source§fn eq(&self, other: &CompileOutcome) -> bool
fn eq(&self, other: &CompileOutcome) -> bool
self and other values to be equal, and is used by ==.impl Eq for CompileOutcome
impl StructuralPartialEq for CompileOutcome
Auto Trait Implementations§
impl Freeze for CompileOutcome
impl RefUnwindSafe for CompileOutcome
impl Send for CompileOutcome
impl Sync for CompileOutcome
impl Unpin for CompileOutcome
impl UnsafeUnpin for CompileOutcome
impl UnwindSafe for CompileOutcome
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.