pub struct Finding {
pub claim: String,
pub status: String,
pub state: ProofState,
pub reason: String,
pub reproduce: Option<String>,
}Expand description
A claim whose declared status the evidence does not support.
Only a guaranteed claim can produce one: the other statuses already say that a current
proof is not what they are claiming. A finding says what was claimed, what the evidence
supports instead, and — where running something would settle it — what to run.
use majordomus_cli::evidence::{Finding, ProofState};
let finding = Finding {
claim: "scope-integrity".into(),
status: "guaranteed".into(),
state: ProofState::NotRun,
reason: "the claim guarantees a behaviour and names a test, and no run of that \
test has ever been recorded"
.into(),
reproduce: Some("bash test/run.sh 07_scope".into()),
};
// the gap is the finding: what the matrix declares against what the ledger holds
assert_ne!(finding.status, finding.state.label());
assert!(finding.reproduce.unwrap().starts_with("bash test/run.sh"));§Example
use majordomus_cli::evidence::{Finding, ProofState};
let f = Finding {
claim: "some-claim".into(),
status: "guaranteed".into(),
state: ProofState::NotRun,
reason: "the claim names a test nobody has run".into(),
reproduce: Some("bash test/run.sh 07_scope".into()),
};
assert_eq!(f.state, ProofState::NotRun);Fields§
§claim: StringThe claim.
status: StringWhat the claim says it is.
state: ProofStateWhat the evidence supports.
reason: StringWhy this is a finding.
reproduce: Option<String>What to run, when running something would settle it.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Finding
impl<'de> Deserialize<'de> for Finding
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>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Finding
Source§impl JsonSchema for Finding
impl JsonSchema for Finding
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreimpl StructuralPartialEq for Finding
Auto Trait Implementations§
impl Freeze for Finding
impl RefUnwindSafe for Finding
impl Send for Finding
impl Sync for Finding
impl Unpin for Finding
impl UnsafeUnpin for Finding
impl UnwindSafe for Finding
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
Mutably borrows from an owned value. Read more
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
Compare self to
key and return true if they are equal.