pub enum Fault {
Undecodable {
position: u64,
detail: String,
},
UnsupportedFormat {
position: u64,
found: u16,
},
BrokenChain {
position: u64,
expected: Option<ContentHash>,
found: Option<ContentHash>,
},
SeqMismatch {
position: u64,
found: u64,
},
}Expand description
The first thing found wrong with a log, if anything was.
One fault, not a list, and deliberately so: after the first break every later record is being judged against a chain that is already wrong, so a list would be one real finding followed by noise.
Variants§
Undecodable
A newline-terminated record did not decode. It was written whole once, so this is damage, not a torn write.
Fields
UnsupportedFormat
A record names a wire format this build does not support.
Fields
BrokenChain
A record’s parent is not the hash of the record before it.
Fields
expected: Option<ContentHash>The hash the previous record actually has.
found: Option<ContentHash>The hash this record claims its parent is.
SeqMismatch
A record’s seq is not its position in the file.
Separate from Fault::BrokenChain because the two fail
independently: a log can renumber without breaking its hashes
(the hash does not cover position) and can break its hashes while
staying numbered correctly.