pub enum PolicyEvent {
Finding(FindingEvent),
WarnUnsafe {
trigger: Trigger,
policy: PolicyId,
},
CoreFinding {
core_id: &'static str,
code: &'static str,
message: String,
},
EngineFailure {
code: EngineFailureCode,
message: String,
trigger: Option<Trigger>,
policy: Option<PolicyId>,
path: Option<EventPath>,
},
FixSummary {
trigger: Trigger,
passes: u64,
changed_paths: Vec<EventPath>,
},
CommitLanded {
oid: String,
},
LandingRaceLost {
attempt: u64,
winning_oid: String,
},
LandingReserved {
lost_races: u64,
},
CommitReplayed {
prepared_oid: String,
from_base: Option<String>,
onto: String,
oid: String,
},
ReplayHeadersDropped {
prepared_oid: String,
oid: String,
headers: Vec<String>,
},
ReplayConflict {
target_ref: String,
paths: Vec<String>,
winning_oid: String,
prepared_oid: String,
},
}Expand description
What:
Every event a policy pass can produce.
An enum is a closed set of named
alternatives;
each variant carries its own fields.
Vec<EventPath> is an owned
list of pathnames in their event form.
Why:
One list of events is rendered in order,
whatever mixture of kinds it holds.
In TS you’d write (pseudocode):
type PolicyEvent = FindingEvent | ConfigurationWarningEvent | CoreFindingEvent | EngineFailureEvent | FixSummaryEvent;Variants§
Finding(FindingEvent)
A policy reported something.
WarnUnsafe
A policy that warn does not protect is configured as warn.
Fields
CoreFinding
A fixed transform rejected the command; it has no severity and cannot be configured.
Fields
EngineFailure
The pass could not complete.
Fields
code: EngineFailureCodeThe stable cause.
FixSummary
Corrections were applied.
Fields
CommitLanded
The landed commit whose automatic backup the post-commit gate stopped. The commit stays local; the event names it so the user can push it deliberately.
LandingRaceLost
A landing found the target moved (landing-race-lost).
Fields
LandingReserved
A commit that lost enough races holds the next landing slot (landing-reserved).
CommitReplayed
A prepared commit was replayed onto the moved target (commit-replayed).
Fields
ReplayHeadersDropped
A signed replay could not carry some custom headers (replay-headers-dropped).
Fields
ReplayConflict
The core finding concurrent-commit/replay-conflict, with the data a person needs to resolve it.
Trait Implementations§
Source§impl Clone for PolicyEvent
impl Clone for PolicyEvent
Source§impl Debug for PolicyEvent
impl Debug for PolicyEvent
impl Eq for PolicyEvent
Source§impl PartialEq for PolicyEvent
impl PartialEq for PolicyEvent
impl StructuralPartialEq for PolicyEvent
Auto Trait Implementations§
impl Freeze for PolicyEvent
impl RefUnwindSafe for PolicyEvent
impl Send for PolicyEvent
impl Sync for PolicyEvent
impl Unpin for PolicyEvent
impl UnsafeUnpin for PolicyEvent
impl UnwindSafe for PolicyEvent
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,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more