pub enum PolicyLifecycle {
Loaded(CompiledId),
Superseded(CompiledId),
Removed(CompiledId),
}Expand description
A policy-lifecycle event, parallel to Lifecycle but scoped to a
compiled artifact rather than an account. Without it, an evaluator that
accumulates state per compiled policy (a cache, a counter) has no way to
learn that one of its artifacts no longer corresponds to anything the
tree will ever route to again, and keeps it forever.
Delivery is not reliable, and does not need to be: a caller who never
sends Removed for a policy that stopped
existing has left an evaluator holding a stale artifact, but the tree
this crate builds decides what is routed anywhere – a stale artifact
nothing routes to is a memory leak, never a correctness problem. See
plan/policy.md’s “a missed removal is inert, not dangerous.” Do not
build retry or acknowledgement machinery for this channel.
Variants§
Loaded(CompiledId)
compile produced this artifact and it is now (or remains) the one
a tree may route decisions to.
Superseded(CompiledId)
A newer compile of the same logical policy succeeded, and this
artifact is no longer the one any tree routes to – safe to drop.
Never sent when a newer revision failed to compile: didbot-pds’s
loader keeps routing to the last-good artifact in that case, so it
is very much still in use – see plan/policy.md’s last-good-
revision behaviour.
Removed(CompiledId)
The record this artifact was compiled from is gone from every source – deleted, or never re-observed after a source’s own failure recovered onto a view that no longer names it. Safe to drop.
Trait Implementations§
Source§impl Clone for PolicyLifecycle
impl Clone for PolicyLifecycle
Source§fn clone(&self) -> PolicyLifecycle
fn clone(&self) -> PolicyLifecycle
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 PolicyLifecycle
impl Debug for PolicyLifecycle
Source§impl PartialEq for PolicyLifecycle
impl PartialEq for PolicyLifecycle
Source§fn eq(&self, other: &PolicyLifecycle) -> bool
fn eq(&self, other: &PolicyLifecycle) -> bool
self and other values to be equal, and is used by ==.impl Copy for PolicyLifecycle
impl Eq for PolicyLifecycle
impl StructuralPartialEq for PolicyLifecycle
Auto Trait Implementations§
impl Freeze for PolicyLifecycle
impl RefUnwindSafe for PolicyLifecycle
impl Send for PolicyLifecycle
impl Sync for PolicyLifecycle
impl Unpin for PolicyLifecycle
impl UnsafeUnpin for PolicyLifecycle
impl UnwindSafe for PolicyLifecycle
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.