pub struct RepositoryEvidence<'a> { /* private fields */ }Expand description
The evidence of a real repository: its ledger, its claim matrix joined to that ledger,
its index and its tree, judged at the working tree by the evidence module’s own
derivation — evidence::report for a claim, evidence::freshness() over the same
evidence::compare for a test — so a criterion is current exactly when the rest of
Majordomus would call its evidence current. The claim join and the comparisons run git,
so each is computed once, and only when a criterion or a governance entry asks.
use majordomus_cli::index::Index;
use majordomus_cli::intent::{EvidenceLookup, RepositoryEvidence};
let evidence = RepositoryEvidence::load(index).expect("the ledger is readable");
// a file the repository does not hold is answered without running git
assert!(!evidence.file("no/such/file.md"));Implementations§
Source§impl<'a> RepositoryEvidence<'a>
impl<'a> RepositoryEvidence<'a>
Sourcepub fn load(index: &'a Index) -> Result<RepositoryEvidence<'a>, Error>
pub fn load(index: &'a Index) -> Result<RepositoryEvidence<'a>, Error>
The evidence of the repository an index was built from. A ledger this executable cannot read is an error, never an empty ledger: a misread one could report a pass that was never recorded.
use majordomus_cli::index::Index;
use majordomus_cli::intent::RepositoryEvidence;
// a ledger that cannot be read is an error here, never an empty ledger
let evidence = RepositoryEvidence::load(index).expect("the ledger is readable");
let _ = &evidence;Trait Implementations§
Source§impl EvidenceLookup for RepositoryEvidence<'_>
impl EvidenceLookup for RepositoryEvidence<'_>
Source§fn test(&self, id: &TestId, scope: &[String]) -> TestStanding
fn test(&self, id: &TestId, scope: &[String]) -> TestStanding
What the ledger holds for one test, by its identity: whether its source is in the tree
and what its latest run came to.
scope is the code the plan declares for the
criterion — the scope of every issue that serves it — which the judgement counts
among the test’s inputs beside what the claims that test proves name. Read moreSource§fn claim(&self, id: &str) -> Option<ClaimStanding>
fn claim(&self, id: &str) -> Option<ClaimStanding>
What a claim’s evidence says, judged as
IntentEvidenceState::judged judges it,
with the claim report’s verdict behind it; None when no such claim is declared —
which is a refusal, not an unproven claim. Read moreSource§fn deployment(&self, id: &str) -> bool
fn deployment(&self, id: &str) -> bool
Whether a deployment object with this id exists. A
deployment criterion resolves
through this and is still never counted as met. Read moreAuto Trait Implementations§
impl<'a> !Freeze for RepositoryEvidence<'a>
impl<'a> !RefUnwindSafe for RepositoryEvidence<'a>
impl<'a> !Sync for RepositoryEvidence<'a>
impl<'a> Send for RepositoryEvidence<'a>
impl<'a> Unpin for RepositoryEvidence<'a>
impl<'a> UnsafeUnpin for RepositoryEvidence<'a>
impl<'a> UnwindSafe for RepositoryEvidence<'a>
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