Skip to main content

RepositoryEvidence

Struct RepositoryEvidence 

Source
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>

Source

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<'_>

Source§

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 more
Source§

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 more
Source§

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 more
Source§

fn object(&self, kind: &str, identity: &str) -> bool

Whether an object of kind answers to identity (rule matches with or without its @version). This is what makes a governance: entry resolve or fail. Read more
Source§

fn file(&self, path: &str) -> bool

Whether a repository-relative file exists, for a file: governance entry and for the test sources a criterion names. Read more

Auto 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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more