pub struct IntentCoverage {
pub criteria: Vec<CriterionCoverage>,
pub issues: Vec<IssuePurpose>,
pub findings: Vec<IntentFinding>,
}Expand description
The whole derived coverage: every criterion of every live intent, every issue with the reason it exists, and every finding the two produced. Nothing here is stored; it is derived on each read from the intents and the plan.
use majordomus_cli::intent_plan::{IntentCoverage, IssueOrigin, IssuePurpose};
let coverage = IntentCoverage {
criteria: vec![],
issues: vec![IssuePurpose {
issue: "I0007".into(),
milestone: "ops".into(),
origin: IssueOrigin::Maintenance,
serves: vec![],
intents: vec![],
}],
findings: vec![],
};
assert_eq!(coverage.failures(), 0);
assert_eq!(coverage.purpose("I0007").unwrap().origin, IssueOrigin::Maintenance);Fields§
§criteria: Vec<CriterionCoverage>Every criterion of every live intent, in intent then declaration order.
issues: Vec<IssuePurpose>Every issue of the plan, in id order, with the reason it exists.
findings: Vec<IntentFinding>Every finding, in derivation order.
Implementations§
Source§impl IntentCoverage
impl IntentCoverage
Sourcepub fn failures(&self) -> usize
pub fn failures(&self) -> usize
How many of the findings are failures rather than warnings: the count that decides
whether majordomus intent validate exits 10.
use majordomus_cli::intent_plan::IntentCoverage;
let clean = IntentCoverage { criteria: vec![], issues: vec![], findings: vec![] };
assert_eq!(clean.failures(), 0);Sourcepub fn purpose(&self, issue: &str) -> Option<&IssuePurpose>
pub fn purpose(&self, issue: &str) -> Option<&IssuePurpose>
The purpose of one issue by id, or None when the plan holds no such issue — the
answer to “why does this issue exist?”.
use majordomus_cli::intent_plan::IntentCoverage;
let coverage = IntentCoverage { criteria: vec![], issues: vec![], findings: vec![] };
assert!(coverage.purpose("I0001").is_none());Sourcepub fn criterion(
&self,
intent: &str,
criterion: &str,
) -> Option<&CriterionCoverage>
pub fn criterion( &self, intent: &str, criterion: &str, ) -> Option<&CriterionCoverage>
The coverage of one <intent>#<criterion>, or None when no live intent declares it
— the answer to “which work carries this criterion?”.
use majordomus_cli::intent_plan::IntentCoverage;
let coverage = IntentCoverage { criteria: vec![], issues: vec![], findings: vec![] };
assert!(coverage.criterion("intent-planning", "gap-is-recorded").is_none());Trait Implementations§
Source§impl Clone for IntentCoverage
impl Clone for IntentCoverage
Source§fn clone(&self) -> IntentCoverage
fn clone(&self) -> IntentCoverage
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 IntentCoverage
impl Debug for IntentCoverage
Source§impl<'de> Deserialize<'de> for IntentCoverage
impl<'de> Deserialize<'de> for IntentCoverage
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 IntentCoverage
Source§impl JsonSchema for IntentCoverage
impl JsonSchema for IntentCoverage
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 IntentCoverage
impl PartialEq for IntentCoverage
Source§fn eq(&self, other: &IntentCoverage) -> bool
fn eq(&self, other: &IntentCoverage) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for IntentCoverage
impl Serialize for IntentCoverage
impl StructuralPartialEq for IntentCoverage
Auto Trait Implementations§
impl Freeze for IntentCoverage
impl RefUnwindSafe for IntentCoverage
impl Send for IntentCoverage
impl Sync for IntentCoverage
impl Unpin for IntentCoverage
impl UnsafeUnpin for IntentCoverage
impl UnwindSafe for IntentCoverage
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.