pub struct IntentCriterion {
pub id: String,
pub criterion: String,
pub evidence: String,
pub reference: String,
pub state: IntentEvidenceState,
pub met: bool,
pub proof: Option<ProofState>,
pub reproduce: Option<String>,
}Expand description
One criterion with the evidence behind it: what the record declared, what the ledger says about it, whether that meets it, and the command that would produce the evidence again.
use majordomus_cli::evidence::ProofState;
use majordomus_cli::intent::{IntentCriterion, IntentEvidenceState};
let c = IntentCriterion {
id: "stage-is-derived".into(),
criterion: "the stage follows the plan".into(),
evidence: "test".into(),
reference: "apps/majordomus-cli/tests/intent.rs".into(),
state: IntentEvidenceState::NotRun,
met: false,
proof: Some(ProofState::NotRun),
reproduce: None,
};
// nothing recorded is not a pass
assert!(!c.met);Fields§
§id: StringUnique within the intent.
criterion: StringWhat is observably true when it is met.
evidence: Stringtest, claim, command or deployment.
reference: StringWhat the evidence names, as authored.
state: IntentEvidenceStateDerived: what the evidence says.
met: boolDerived: the state is current.
proof: Option<ProofState>Derived: the evidence module’s own verdict behind state, for a test or claim
criterion whose reference resolves. A met criterion rests on proven (a pass at this
revision) or inputs_unchanged (a pass whose named inputs have not moved since, which
is not proof at this revision), and every surface shows which, so met is never the
one tick for both.
reproduce: Option<String>The command that produces the evidence again, when one is known.
Trait Implementations§
Source§impl Clone for IntentCriterion
impl Clone for IntentCriterion
Source§fn clone(&self) -> IntentCriterion
fn clone(&self) -> IntentCriterion
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for IntentCriterion
impl Debug for IntentCriterion
Source§impl<'de> Deserialize<'de> for IntentCriterion
impl<'de> Deserialize<'de> for IntentCriterion
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 IntentCriterion
Source§impl JsonSchema for IntentCriterion
impl JsonSchema for IntentCriterion
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 PartialEq for IntentCriterion
impl PartialEq for IntentCriterion
Source§fn eq(&self, other: &IntentCriterion) -> bool
fn eq(&self, other: &IntentCriterion) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for IntentCriterion
impl Serialize for IntentCriterion
impl StructuralPartialEq for IntentCriterion
Auto Trait Implementations§
impl Freeze for IntentCriterion
impl RefUnwindSafe for IntentCriterion
impl Send for IntentCriterion
impl Sync for IntentCriterion
impl Unpin for IntentCriterion
impl UnsafeUnpin for IntentCriterion
impl UnwindSafe for IntentCriterion
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<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.