Skip to main content

CompileOutcome

Enum CompileOutcome 

Source
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

Source§

fn clone(&self) -> CompileOutcome

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CompileOutcome

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for CompileOutcome

Source§

fn eq(&self, other: &CompileOutcome) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for CompileOutcome

Source§

impl StructuralPartialEq for CompileOutcome

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.