pub fn read(root: &Path) -> (Vec<Entry>, usize)Expand description
Read the record of root, oldest first.
A line that does not parse is skipped rather than fatal: the ledger is append-only and survives every version of every writer that ever appended to it, so a reader that refused the whole file over one malformed line would lose the history it exists to show. The count of skipped lines is returned beside the entries so the loss is never silent.
// A checkout that has never written one has no record, which is an empty answer rather
// than an error: absence is a state the lifecycle has, not a failure to read.
let (entries, skipped) = majordomus_cli::ledger::read(std::path::Path::new("/nonexistent"));
assert!(entries.is_empty() && skipped == 0);