Skip to main content

GateOutcomes

Struct GateOutcomes 

Source
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>

Source

pub const fn new() -> Self

An empty set. Self::into_option makes it absent.

Source

pub fn insert(&mut self, name: K, outcome: GateOutcome)

Record the outcome of one gate. A previous entry for that name goes.

Source

pub fn insert_if(&mut self, name: K, outcome: Option<GateOutcome>)

Record the outcome of one gate when the gate ran.

Source

pub fn get<Q>(&self, name: &Q) -> Option<&GateOutcome>
where K: Borrow<Q>, Q: Ord + ?Sized,

Read the outcome of one gate.

Source

pub fn fails_run(&self) -> bool

Whether a gate of the set fails the run: its status is fail and it is enforced.

Source

pub fn is_empty(&self) -> bool

Whether the set holds no gate.

Source

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: Clone + Ord> Clone for GateOutcomes<K>

Source§

fn clone(&self) -> Self

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<K: Debug + Ord> Debug for GateOutcomes<K>

Source§

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

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

impl<K: Ord> Default for GateOutcomes<K>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<K: PartialEq + Ord> PartialEq for GateOutcomes<K>

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl<K> Serialize for GateOutcomes<K>
where K: Serialize + Ord,

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<K: PartialEq + Ord> StructuralPartialEq for GateOutcomes<K>

Auto Trait Implementations§

§

impl<K> Forget for GateOutcomes<K>

§

impl<K> Freeze for GateOutcomes<K>
where *const LeafNode<K, GateOutcome> is !null: Freeze, PhantomData<(Owned, LeafOrInternal)>: Freeze, PhantomData<Box<(K, GateOutcome)>>: Freeze,

§

impl<K> Move for GateOutcomes<K>

§

impl<K> RefUnwindSafe for GateOutcomes<K>
where K: RefUnwindSafe,

§

impl<K> Send for GateOutcomes<K>
where NodeRef<Owned, K, GateOutcome, LeafOrInternal>: Send, BoxRaw<(K, GateOutcome)>: Send,

§

impl<K> Sync for GateOutcomes<K>
where NodeRef<Owned, K, GateOutcome, LeafOrInternal>: Sync, BoxRaw<(K, GateOutcome)>: Sync,

§

impl<K> Unpin for GateOutcomes<K>
where *const LeafNode<K, GateOutcome> is !null: Unpin, Box<(K, GateOutcome)>: Unpin,

§

impl<K> UnsafeUnpin for GateOutcomes<K>
where *const LeafNode<K, GateOutcome> is !null: UnsafeUnpin, PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin, PhantomData<Box<(K, GateOutcome)>>: UnsafeUnpin,

§

impl<K> UnwindSafe for GateOutcomes<K>

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
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 = !

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

fn try_from(value: U) -> Result<T, !>

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.