pub struct LedgerRead {
pub events: Vec<Value>,
pub corrupt: Vec<Corruption>,
}Expand description
What a read of the ledger found: the lines that parsed, in ledger order, and the lines that did not, named rather than dropped.
use majordomus_cli::session::{Ledger, LedgerRead};
let dir = tempfile::tempdir().unwrap();
let path = dir.path().join("ledger.jsonl");
std::fs::write(&path, "{\"ts\":\"a\"}\nbroken\n").unwrap();
let read: LedgerRead = Ledger::at(&path).read();
assert_eq!(read.events.len(), 1);
assert_eq!(read.corrupt.len(), 1);Fields§
§events: Vec<Value>The lines that parsed, in ledger order — which is the order the commands ran, and is what makes two events inside one second need no tiebreak.
corrupt: Vec<Corruption>The lines that did not. Named rather than dropped: a reader that silently omits a line cannot tell a ledger with a truncated tail from one that recorded less.
Trait Implementations§
Source§impl Clone for LedgerRead
impl Clone for LedgerRead
Source§fn clone(&self) -> LedgerRead
fn clone(&self) -> LedgerRead
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for LedgerRead
impl Debug for LedgerRead
Source§impl Default for LedgerRead
impl Default for LedgerRead
Source§fn default() -> LedgerRead
fn default() -> LedgerRead
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for LedgerRead
impl<'de> Deserialize<'de> for LedgerRead
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl JsonSchema for LedgerRead
impl JsonSchema for LedgerRead
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreSource§impl PartialEq for LedgerRead
impl PartialEq for LedgerRead
Source§fn eq(&self, other: &LedgerRead) -> bool
fn eq(&self, other: &LedgerRead) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for LedgerRead
impl Serialize for LedgerRead
impl StructuralPartialEq for LedgerRead
Auto Trait Implementations§
impl Freeze for LedgerRead
impl RefUnwindSafe for LedgerRead
impl Send for LedgerRead
impl Sync for LedgerRead
impl Unpin for LedgerRead
impl UnsafeUnpin for LedgerRead
impl UnwindSafe for LedgerRead
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