pub enum GateStatus {
Pass,
Fail,
Stale,
Blocked,
Queued,
Exempt,
Unknown,
}Expand description
use majordomus_cli::gates::GateStatus;
// the three answers a reader is entitled to, and they are different answers
assert!(GateStatus::Fail.refuses(), "a run that failed refuses");
assert!(GateStatus::Queued.unverified(), "asked and unanswered is a debt");
assert!(!GateStatus::Exempt.refuses() && !GateStatus::Exempt.unverified());
// and the one that is neither: a run whose tree has moved proves nothing about this one
assert!(GateStatus::Stale.refuses());
assert_eq!(GateStatus::Stale.as_str(), "stale");What is known about one gate. Every word is one this repository’s design tokens already
carry (share/design/tokens.yaml, status.states), so a surface renders it without
being taught a sixth vocabulary and the design gate does not refuse it.
Variants§
Pass
It ran over these inputs and succeeded. The only word that discharges anything.
Fail
It ran over these inputs and failed. Completion is refused.
Stale
It ran, and the files that select it have changed since; what it proved is about a tree that no longer exists. Completion is refused, because the alternative is treating a claim about the past as a claim about the present.
Blocked
Something it cannot run without has not passed, so its own silence means nothing.
Queued
The plan selects it and no run has ever reported. Not unknown: the question was
asked and no answer came, which is a debt somebody owes, and not pass, which is
the mistake this word exists to make impossible.
Exempt
The plan does not select it: nothing the task changed can make it true or false.
Unknown
It cannot be judged here at all — no model, no git, a ledger that would not read. An honest gap, and never a pass.
Implementations§
Source§impl GateStatus
impl GateStatus
Sourcepub fn as_str(self) -> &'static str
pub fn as_str(self) -> &'static str
The word this status is reported under.
use majordomus_cli::gates::GateStatus;
assert_eq!(GateStatus::Queued.as_str(), "queued");
// green and never-reported are different words, which is the whole point
assert_ne!(GateStatus::Pass.as_str(), GateStatus::Queued.as_str());Sourcepub fn refuses(self) -> bool
pub fn refuses(self) -> bool
Does this status, on a required gate, refuse canonical completion?
True only for what is known to be wrong: a run that failed, a run whose evidence
no longer describes the tree, and a gate whose prerequisite is in one of those
states. Absence does not refuse — queued and unknown are reported as unverified,
and a worker who claims a task is finished over them is making a claim the record
contradicts rather than one the tool accepted.
use majordomus_cli::gates::GateStatus;
assert!(GateStatus::Fail.refuses() && GateStatus::Stale.refuses());
assert!(!GateStatus::Queued.refuses(), "absence is a debt, not a failure");
assert!(!GateStatus::Exempt.refuses());Sourcepub fn unverified(self) -> bool
pub fn unverified(self) -> bool
Is this status the absence of a verdict rather than a verdict?
use majordomus_cli::gates::GateStatus;
// asked and unanswered, or unaskable: two different gaps, both reported as gaps
assert!(GateStatus::Queued.unverified() && GateStatus::Unknown.unverified());
// a verdict is a verdict whichever way it went
assert!(!GateStatus::Pass.unverified() && !GateStatus::Fail.unverified());
// and a gate the change cannot affect was never a question
assert!(!GateStatus::Exempt.unverified());Trait Implementations§
Source§impl Clone for GateStatus
impl Clone for GateStatus
Source§fn clone(&self) -> GateStatus
fn clone(&self) -> GateStatus
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for GateStatus
Source§impl Debug for GateStatus
impl Debug for GateStatus
Source§impl<'de> Deserialize<'de> for GateStatus
impl<'de> Deserialize<'de> for GateStatus
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for GateStatus
Source§impl JsonSchema for GateStatus
impl JsonSchema for GateStatus
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl Ord for GateStatus
impl Ord for GateStatus
Source§fn cmp(&self, other: &GateStatus) -> Ordering
fn cmp(&self, other: &GateStatus) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for GateStatus
impl PartialEq for GateStatus
Source§fn eq(&self, other: &GateStatus) -> bool
fn eq(&self, other: &GateStatus) -> bool
self and other values to be equal, and is used by ==.Source§impl PartialOrd for GateStatus
impl PartialOrd for GateStatus
Source§impl Serialize for GateStatus
impl Serialize for GateStatus
impl StructuralPartialEq for GateStatus
Auto Trait Implementations§
impl Freeze for GateStatus
impl RefUnwindSafe for GateStatus
impl Send for GateStatus
impl Sync for GateStatus
impl Unpin for GateStatus
impl UnsafeUnpin for GateStatus
impl UnwindSafe for GateStatus
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§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.