pub enum ObligationState {
Owed,
Discharged,
Stale,
Undeclared,
}Expand description
Where one obligation stands.
The words are the validator’s verdicts, not a severity scale: stale is not a worse
owed, it is evidence that was true and no longer describes what it proved.
use majordomus_cli::capability::builtin::obligations::ObligationState;
// only one of the four lets a task be called completed
let completable = |s: ObligationState| s == ObligationState::Discharged;
assert!(completable(ObligationState::Discharged));
assert!(!completable(ObligationState::Stale), "evidence that no longer describes the tree");
assert!(!completable(ObligationState::Owed));
assert!(!completable(ObligationState::Undeclared));Variants§
Owed
Declared, and no evidence for it was ever recorded.
Discharged
Evidence exists and still describes this tree, or this commit.
Stale
Evidence exists and no longer describes what it proved: the inputs changed, or the commit it named is not this one.
Undeclared
The task requires a token the shipped vocabulary does not declare. Nothing can discharge it, because nothing knows what would.
Implementations§
Source§impl ObligationState
impl ObligationState
Sourcepub fn as_str(self) -> &'static str
pub fn as_str(self) -> &'static str
The word as serialised, for a caller that tallies or renders states without
carrying a copy of the vocabulary: the tallies of a Closure are keyed by
exactly these strings, and so is anything that groups the entries by standing.
use majordomus_cli::capability::builtin::obligations::ObligationState;
assert_eq!(ObligationState::Stale.as_str(), "stale");
assert_eq!(ObligationState::Undeclared.as_str(), "undeclared");Trait Implementations§
Source§impl Clone for ObligationState
impl Clone for ObligationState
Source§fn clone(&self) -> ObligationState
fn clone(&self) -> ObligationState
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 ObligationState
Source§impl Debug for ObligationState
impl Debug for ObligationState
Source§impl<'de> Deserialize<'de> for ObligationState
impl<'de> Deserialize<'de> for ObligationState
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 ObligationState
Source§impl JsonSchema for ObligationState
impl JsonSchema for ObligationState
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 ObligationState
impl Ord for ObligationState
Source§fn cmp(&self, other: &ObligationState) -> Ordering
fn cmp(&self, other: &ObligationState) -> 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 ObligationState
impl PartialEq for ObligationState
Source§fn eq(&self, other: &ObligationState) -> bool
fn eq(&self, other: &ObligationState) -> bool
self and other values to be equal, and is used by ==.Source§impl PartialOrd for ObligationState
impl PartialOrd for ObligationState
Source§impl Serialize for ObligationState
impl Serialize for ObligationState
impl StructuralPartialEq for ObligationState
Auto Trait Implementations§
impl Freeze for ObligationState
impl RefUnwindSafe for ObligationState
impl Send for ObligationState
impl Sync for ObligationState
impl Unpin for ObligationState
impl UnsafeUnpin for ObligationState
impl UnwindSafe for ObligationState
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.