pub struct LedgerSummary {
pub path: String,
pub present: bool,
pub executions: usize,
pub newest: Option<String>,
pub commits: Vec<String>,
}Expand description
What the ledger is and whether it is there at all.
A report that did not say where its evidence came from would be asking to be believed. This is the provenance of the whole report: the file, how much it holds, how old the newest entry is, and which commits anything was ever recorded against.
use majordomus_cli::evidence::{Ledger, LedgerSummary, LEDGER_PATH};
let summary: LedgerSummary = Ledger::empty().summary();
assert_eq!(summary.path, LEDGER_PATH);
assert!(!summary.present, "a ledger holding nothing has recorded nothing");
assert_eq!(summary.executions, 0);
assert!(summary.newest.is_none());
assert!(summary.commits.is_empty());§Example
use majordomus_cli::evidence::LedgerSummary;
let s = LedgerSummary {
path: ".ai/repo/evidence/ledger.json".into(),
present: false,
executions: 0,
newest: None,
commits: vec![],
};
assert!(!s.present, "a repository that recorded nothing says so");Fields§
§path: StringWhere it lives, repository-relative.
present: boolWhether the ledger holds at least one execution.
Not whether the file exists. A ledger file holding nothing and no ledger file at
all are the same answer to the only question a reader is asking — has anything
been recorded — and both make every claim read not_run. Ledger::present
answers the filesystem question, and nothing derives a proof state from it.
executions: usizeHow many executions it holds.
newest: Option<String>The newest at in it, when it holds any.
commits: Vec<String>The distinct commits its executions were recorded against. Always emitted, empty
included, for the reason ClaimProof::changed is.
Trait Implementations§
Source§impl Clone for LedgerSummary
impl Clone for LedgerSummary
Source§fn clone(&self) -> LedgerSummary
fn clone(&self) -> LedgerSummary
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 LedgerSummary
impl Debug for LedgerSummary
Source§impl<'de> Deserialize<'de> for LedgerSummary
impl<'de> Deserialize<'de> for LedgerSummary
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 LedgerSummary
Source§impl JsonSchema for LedgerSummary
impl JsonSchema for LedgerSummary
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 LedgerSummary
impl PartialEq for LedgerSummary
Source§fn eq(&self, other: &LedgerSummary) -> bool
fn eq(&self, other: &LedgerSummary) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for LedgerSummary
impl Serialize for LedgerSummary
impl StructuralPartialEq for LedgerSummary
Auto Trait Implementations§
impl Freeze for LedgerSummary
impl RefUnwindSafe for LedgerSummary
impl Send for LedgerSummary
impl Sync for LedgerSummary
impl Unpin for LedgerSummary
impl UnsafeUnpin for LedgerSummary
impl UnwindSafe for LedgerSummary
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.