pub struct ConvergenceReport {
pub schema: String,
pub repository: String,
pub trunk: Option<String>,
pub holdings: Vec<Holding>,
pub tallies: BTreeMap<String, usize>,
pub at_risk: usize,
pub converged: bool,
}Expand description
The repository’s convergence: every holding, and the one verdict over them.
use majordomus_cli::convergence::{ConvergenceReport, SCHEMA};
let empty = ConvergenceReport {
schema: SCHEMA.into(),
repository: "/tmp/r".into(),
trunk: Some("master".into()),
holdings: vec![],
tallies: Default::default(),
at_risk: 0,
converged: true,
};
// the verdict is the one word a gate reads; the count is what a person reads next to it
assert!(empty.converged && empty.at_risk == 0);
assert_eq!(serde_json::to_value(&empty).unwrap()["schema"], "convergence/v1");Fields§
§schema: String§repository: StringThe primary checkout this was measured from.
trunk: Option<String>The trunk the containment was decided against, when there is one.
holdings: Vec<Holding>Every holding, at-risk ones first, then by kind and identity.
tallies: BTreeMap<String, usize>How many holdings carry each disposition, by its word.
at_risk: usizeThe holdings that exist on one disk only.
converged: boolNothing is held where it can be lost.
Implementations§
Source§impl ConvergenceReport
impl ConvergenceReport
Sourcepub fn summary(&self) -> String
pub fn summary(&self) -> String
The one line a person or a gate reads first, stating the count it refuses over.
use majordomus_cli::convergence::{ConvergenceReport, SCHEMA};
let mut report = ConvergenceReport {
schema: SCHEMA.into(),
repository: "/tmp/r".into(),
trunk: None,
holdings: vec![],
tallies: Default::default(),
at_risk: 0,
converged: true,
};
assert!(report.summary().starts_with("converged"));
report.at_risk = 2;
report.converged = false;
assert!(report.summary().starts_with("not converged: 2 of"));Trait Implementations§
Source§impl Clone for ConvergenceReport
impl Clone for ConvergenceReport
Source§fn clone(&self) -> ConvergenceReport
fn clone(&self) -> ConvergenceReport
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ConvergenceReport
impl Debug for ConvergenceReport
Source§impl<'de> Deserialize<'de> for ConvergenceReport
impl<'de> Deserialize<'de> for ConvergenceReport
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 ConvergenceReport
Source§impl JsonSchema for ConvergenceReport
impl JsonSchema for ConvergenceReport
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 moreSource§impl PartialEq for ConvergenceReport
impl PartialEq for ConvergenceReport
Source§fn eq(&self, other: &ConvergenceReport) -> bool
fn eq(&self, other: &ConvergenceReport) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for ConvergenceReport
impl Serialize for ConvergenceReport
impl StructuralPartialEq for ConvergenceReport
Auto Trait Implementations§
impl Freeze for ConvergenceReport
impl RefUnwindSafe for ConvergenceReport
impl Send for ConvergenceReport
impl Sync for ConvergenceReport
impl Unpin for ConvergenceReport
impl UnsafeUnpin for ConvergenceReport
impl UnwindSafe for ConvergenceReport
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.