pub struct MeshVerifyReport {
pub ok: bool,
pub runtime: Option<String>,
pub checks: Vec<MeshVerifyCheck>,
pub peers: Vec<PeerVerdict>,
pub digest: Option<String>,
}Expand description
What mesh verify found: the local checks, every peer’s round, and the state digest
afterwards. The digest is what makes the report worth running on two machines — two
runtimes that print the same digest have the same sessions, claims, handovers and
reviews, and two that do not have something to reconcile, whatever their links say.
ok is the conjunction of everything below it, so a caller may act on the one field
and a person may read the rest to find out which part of it was false.
use majordomus_cli::mesh::cooperation::MeshVerifyReport;
let report: MeshVerifyReport = cooperation.verify();
assert_eq!(report.runtime.as_deref(), Some(cooperation.runtime_key()));
assert_eq!(report.digest, Some(cooperation.state().digest), "what a peer is compared to");
assert_eq!(report.ok, report.checks.iter().all(|c| c.ok), "one field for every check");Fields§
§ok: boolWhether every check holds and every round succeeded.
runtime: Option<String>This runtime.
checks: Vec<MeshVerifyCheck>The checks, in the order they ran.
peers: Vec<PeerVerdict>Every linked peer’s verdict.
digest: Option<String>The state digest after the rounds.
Implementations§
Source§impl MeshVerifyReport
impl MeshVerifyReport
Sourcepub fn inactive(reason: &str) -> Self
pub fn inactive(reason: &str) -> Self
The report of a runtime where cooperation does not run.
Not running is a failing verification rather than an empty one: a person who asked whether the mesh works has been told no, and the single check carries the impact — nothing leaves or reaches this runtime — and the steps that would turn it on.
use majordomus_cli::mesh::cooperation::MeshVerifyReport;
let report = MeshVerifyReport::inactive("cooperation is disabled in the declaration");
assert!(!report.ok, "a mesh that does not run has not been verified");
let check = &report.checks[0];
assert!(check.impact.is_some() && check.remediation.is_some(), "what it costs, and the fix");Trait Implementations§
Source§impl Clone for MeshVerifyReport
impl Clone for MeshVerifyReport
Source§fn clone(&self) -> MeshVerifyReport
fn clone(&self) -> MeshVerifyReport
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 MeshVerifyReport
impl Debug for MeshVerifyReport
Source§impl<'de> Deserialize<'de> for MeshVerifyReport
impl<'de> Deserialize<'de> for MeshVerifyReport
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>,
Source§impl JsonSchema for MeshVerifyReport
impl JsonSchema for MeshVerifyReport
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 more