#[non_exhaustive]pub enum LedgerError {
Io {
path: String,
err: String,
},
Serde(String),
Tamper {
seq: u64,
why: String,
},
TornTail {
healed_entries: u64,
healed_root: Option<String>,
torn_path: String,
torn_from_offset: u64,
},
}Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Io
Serde(String)
Tamper
TornTail
The log’s FINAL physical line is structurally incomplete — the file does
not end in a newline, so the trailing record was only partially written
(a crash between/mid the single append write and its flush/sync).
DISTINCT from Tamper on purpose: a benign
crash-during-append must never be reported as an attack. The verified
PREFIX — every fully-terminated, chain-valid, signature-valid record —
is intact and is the ledger; healed_entries is its length and
healed_root its head hash. The open path HEALS this (truncates the torn
fragment at torn_from_offset in torn_path) after first confirming the
prefix still extends any persisted anchor — because a crash can only ever
drop an un-acked tail, whereas a shorter-than-anchor prefix means acked
history was deleted and stays Tamper. The
read-only verify* entry points surface this variant rather than healing.
Trait Implementations§
Source§impl Debug for LedgerError
impl Debug for LedgerError
Source§impl Display for LedgerError
impl Display for LedgerError
Source§impl Error for LedgerError
impl Error for LedgerError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()