pub struct Check {
pub id: String,
pub title: String,
pub verdict: Verdict,
pub summary: String,
pub evidence: Vec<Evidence>,
pub next: Option<String>,
}Expand description
One claim, its verdict, and what the verdict rests on.
use majordomus_cli::environment::preflight::{Check, Evidence, Verdict};
// a claim of something in force without evidence is not accepted as one
let bare = Check::new("integration.mcp", "MCP", Verdict::Verified, "healthy", vec![]);
assert_eq!(bare.verdict, Verdict::Unknown);
assert!(bare.summary.contains("no evidence"));
let backed = Check::new(
"integration.mcp", "MCP", Verdict::Verified, "served",
vec![Evidence::new("GET /", "surface mcp ready")],
);
assert_eq!(backed.verdict, Verdict::Verified);Fields§
§id: StringA stable dotted id, <section>.<claim>.
title: StringThe short name a person reads.
verdict: VerdictWhat the repository can show.
summary: StringThe verdict in one sentence, with the numbers that decided it.
evidence: Vec<Evidence>Everything the verdict rests on. Never empty for a verdict that proves something.
next: Option<String>The command that shows more, or that changes the verdict.
Implementations§
Source§impl Check
impl Check
Sourcepub fn new(
id: impl Into<String>,
title: impl Into<String>,
verdict: Verdict,
summary: impl Into<String>,
evidence: Vec<Evidence>,
) -> Self
pub fn new( id: impl Into<String>, title: impl Into<String>, verdict: Verdict, summary: impl Into<String>, evidence: Vec<Evidence>, ) -> Self
A check. A verdict that Verdict::proves something and arrives without evidence
becomes Verdict::Unknown, with the summary saying so.
use majordomus_cli::environment::preflight::{Check, Verdict};
let c = Check::new("x.y", "Y", Verdict::Stale, "counted at another commit", vec![]);
assert_eq!(c.verdict, Verdict::Stale, "only a claim of force needs evidence");Sourcepub fn next(self, command: impl Into<String>) -> Self
pub fn next(self, command: impl Into<String>) -> Self
The same check, naming the command that shows more.
use majordomus_cli::environment::preflight::{Check, Verdict};
let c = Check::new("x.y", "Y", Verdict::Unknown, "not probed", vec![])
.next("majordomus serve status");
assert_eq!(c.next.as_deref(), Some("majordomus serve status"));Trait Implementations§
Source§impl<'de> Deserialize<'de> for Check
impl<'de> Deserialize<'de> for Check
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 Check
Source§impl JsonSchema for Check
impl JsonSchema for Check
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 Check
Auto Trait Implementations§
impl Freeze for Check
impl RefUnwindSafe for Check
impl Send for Check
impl Sync for Check
impl Unpin for Check
impl UnsafeUnpin for Check
impl UnwindSafe for Check
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.