pub struct PolicyDeclaration {
pub applicability: Applicability,
pub observes: Applicability,
pub staleness: Staleness,
pub predicate: Predicate,
pub revision: Revision,
}Expand description
One policy: its applicability, its observation surface, its staleness mode, its predicate, and its own revision.
A policy is not its wrapper — see plan/policy.md’s “A policy is not its
wrapper”. This is the policy itself, already stripped of the
transport-shaped metadata (source, format version) that got it here.
Fields§
§applicability: ApplicabilityWhat this policy may be asked to decide. Feeds the decision tree that
PolicyTree::decision_candidates
walks. Simple declarative data, deliberately never delegated to an
engine — see Predicate’s doc comment for why a
PolicyDeclaration is never reached at all when this cannot be
made sense of, and holds only the one real failure: a
known-good applicability paired with a predicate that is not.
observes: ApplicabilityWhat this policy is told about, whether or not it is the one
deciding. Feeds a second, independent tree — see
Evaluator::observe’s doc
comment for why this has to be separate from applicability.
staleness: StalenessHow stale this policy’s evaluator’s view may be. Duplicated per policy rather than looked up from the evaluator, even though one evaluator answers the same for all of its policies today, because a future evaluator serving policies of genuinely different staleness should not require restructuring this type.
predicate: PredicateWhat decides this policy — a working evaluator, or a named
Predicate::Unusable.
revision: RevisionThis policy record’s own revision. See Revision.
Trait Implementations§
Source§impl Clone for PolicyDeclaration
impl Clone for PolicyDeclaration
Source§fn clone(&self) -> PolicyDeclaration
fn clone(&self) -> PolicyDeclaration
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 PolicyDeclaration
impl Debug for PolicyDeclaration
Source§impl PartialEq for PolicyDeclaration
impl PartialEq for PolicyDeclaration
Source§fn eq(&self, other: &PolicyDeclaration) -> bool
fn eq(&self, other: &PolicyDeclaration) -> bool
self and other values to be equal, and is used by ==.impl Eq for PolicyDeclaration
impl StructuralPartialEq for PolicyDeclaration
Auto Trait Implementations§
impl Freeze for PolicyDeclaration
impl RefUnwindSafe for PolicyDeclaration
impl Send for PolicyDeclaration
impl Sync for PolicyDeclaration
impl Unpin for PolicyDeclaration
impl UnsafeUnpin for PolicyDeclaration
impl UnwindSafe for PolicyDeclaration
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.