pub struct RuleProof {
pub rule: RuleDefinition,
pub validator: Option<ValidatorRef>,
pub tests: Vec<TestProof>,
pub gates: Vec<String>,
pub required_by: Vec<String>,
pub state: RuleState,
pub meaning: String,
pub satisfied: bool,
}Expand description
One rule, joined to everything the repository can show about it.
§Example
A RuleProof is what report produces per rule; satisfied is whether the state
supports the class the rule declares, which is the whole question.
use majordomus_cli::rules::{report, RuleProof, RuleState};
use majordomus_cli::evidence::Ledger;
use majordomus_cli::synthetic::SyntheticRepository;
let repo = SyntheticRepository::small().unwrap();
let ledger = Ledger::load(repo.root()).unwrap();
let r = report(&repo.index().unwrap(), &ledger);
let first: &RuleProof = &r.rules[0];
assert_eq!(first.state, RuleState::Unproven);
assert!(first.satisfied, "an advisory rule owes no executable proof");Fields§
§rule: RuleDefinitionThe canonical definition.
validator: Option<ValidatorRef>The validator, when the mode is dispatched.
tests: Vec<TestProof>Every test the rule names, joined to the ledger.
gates: Vec<String>Every CI gate that runs something this rule names, deduplicated.
required_by: Vec<String>The rules that depend on this one, by id — the converse of depends_on, which no
rule declares and which a reader always wants.
state: RuleStateWhat the repository can say, as a whole.
meaning: StringThat state, in one sentence.
satisfied: boolWhether the state is one this rule’s class can live with.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for RuleProof
impl<'de> Deserialize<'de> for RuleProof
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 RuleProof
Source§impl JsonSchema for RuleProof
impl JsonSchema for RuleProof
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 Ordered for RuleProof
A proof is ordered by the rule it is about: one comparator, so a filtered report and the
whole report cannot disagree about the sequence.
impl Ordered for RuleProof
A proof is ordered by the rule it is about: one comparator, so a filtered report and the whole report cannot disagree about the sequence.
impl StructuralPartialEq for RuleProof
Auto Trait Implementations§
impl Freeze for RuleProof
impl RefUnwindSafe for RuleProof
impl Send for RuleProof
impl Sync for RuleProof
impl Unpin for RuleProof
impl UnsafeUnpin for RuleProof
impl UnwindSafe for RuleProof
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.