pub struct GateOutcomes<K: Ord>(/* private fields */);Expand description
The verdict of every gate that a run evaluated, keyed by gate name.
Each tool defines its own gate names. The name of a gate is the JSON member name, and the members are in the order of the names. A tool never writes an empty object. When no gate ran, the member is absent.
The key set is OPEN. A name that a consumer does not recognize means “some gate”, not an error.
Implementations§
Source§impl<K: Ord> GateOutcomes<K>
impl<K: Ord> GateOutcomes<K>
Sourcepub const fn new() -> Self
pub const fn new() -> Self
An empty set. Self::into_option makes it absent.
Sourcepub fn insert(&mut self, name: K, outcome: GateOutcome)
pub fn insert(&mut self, name: K, outcome: GateOutcome)
Record the outcome of one gate. A previous entry for that name goes.
Sourcepub fn insert_if(&mut self, name: K, outcome: Option<GateOutcome>)
pub fn insert_if(&mut self, name: K, outcome: Option<GateOutcome>)
Record the outcome of one gate when the gate ran.
Sourcepub fn get<Q>(&self, name: &Q) -> Option<&GateOutcome>
pub fn get<Q>(&self, name: &Q) -> Option<&GateOutcome>
Read the outcome of one gate.
Sourcepub fn fails_run(&self) -> bool
pub fn fails_run(&self) -> bool
Whether a gate of the set fails the run: its status is fail and it
is enforced.
Sourcepub fn into_option(self) -> Option<Self>
pub fn into_option(self) -> Option<Self>
Make an empty set None. This keeps the member absent on a run that
evaluated no gate.
Trait Implementations§
Source§impl<K: Ord> Default for GateOutcomes<K>
impl<K: Ord> Default for GateOutcomes<K>
Source§impl<K> Serialize for GateOutcomes<K>
impl<K> Serialize for GateOutcomes<K>
impl<K: PartialEq + Ord> StructuralPartialEq for GateOutcomes<K>
Auto Trait Implementations§
impl<K> Freeze for GateOutcomes<K>
impl<K> RefUnwindSafe for GateOutcomes<K>
impl<K> Send for GateOutcomes<K>
impl<K> Sync for GateOutcomes<K>
impl<K> Unpin for GateOutcomes<K>
impl<K> UnsafeUnpin for GateOutcomes<K>
impl<K> UnwindSafe for GateOutcomes<K>
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
Mutably borrows from an owned value. Read more