pub enum Verdict {
Verified,
Active,
Fresh,
Stale,
Degraded,
Unavailable,
Failed,
Unknown,
NotApplicable,
}Expand description
What the repository can show about one claim.
Nine words, not a boolean, because the actions they call for differ: stale is re-run
the proof, unavailable is nothing is there, unknown is nobody looked, and
not_applicable is there is nothing to look for.
use majordomus_cli::environment::preflight::Verdict;
assert!(Verdict::Verified.proves() && Verdict::Active.proves() && Verdict::Fresh.proves());
assert!(!Verdict::Stale.proves() && !Verdict::NotApplicable.proves());
assert_eq!(Verdict::NotApplicable.as_str(), "not_applicable");
// the most urgent first: a failure outranks a stale proof, which outranks an absence
assert!(Verdict::Failed.urgency() < Verdict::Stale.urgency());
assert_eq!(Verdict::Verified.urgency(), None);Variants§
Verified
Proven against this tree by a recorded result or a direct answer.
Active
In force now, observed directly, with nothing recorded to verify.
Fresh
Judged recent enough to act on, against a declared threshold or the current commit.
Stale
Evidence exists, but it is about another commit, tree or moment.
Degraded
In force, but in a form that is not the one this executable would serve.
Nothing is there to observe.
Failed
Observed, and it did not hold.
Unknown
Nobody looked, or the looking did not finish.
NotApplicable
There is nothing here to judge.
Implementations§
Source§impl Verdict
impl Verdict
Sourcepub fn as_str(self) -> &'static str
pub fn as_str(self) -> &'static str
The word as serialised and printed.
use majordomus_cli::environment::preflight::Verdict;
assert_eq!(Verdict::Degraded.as_str(), "degraded");Sourcepub fn proves(self) -> bool
pub fn proves(self) -> bool
Does this verdict assert that something is in force? Only these three need evidence to be constructed, and only these three may be drawn as a success.
use majordomus_cli::environment::preflight::Verdict;
assert!(Verdict::Fresh.proves());
assert!(!Verdict::Unknown.proves());Trait Implementations§
impl Copy for Verdict
Source§impl<'de> Deserialize<'de> for Verdict
impl<'de> Deserialize<'de> for Verdict
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 Verdict
Source§impl JsonSchema for Verdict
impl JsonSchema for Verdict
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 Verdict
impl Ord for Verdict
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialOrd for Verdict
impl PartialOrd for Verdict
impl StructuralPartialEq for Verdict
Auto Trait Implementations§
impl Freeze for Verdict
impl RefUnwindSafe for Verdict
impl Send for Verdict
impl Sync for Verdict
impl Unpin for Verdict
impl UnsafeUnpin for Verdict
impl UnwindSafe for Verdict
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.