Enum JournalError
pub enum JournalError {
Show 15 variants
Io(Error),
Serialize(String),
Deserialize(String),
SeqGap {
expected: u64,
got: u64,
},
DuplicateEventId(Uuid),
TruncatedRecord,
UnsupportedSchemaVersion(u16),
PayloadTooLarge {
size: usize,
},
NoValidFrames {
file_len: u64,
},
RunIdMismatch {
expected: Uuid,
got: Uuid,
},
InconsistentRunId {
seq: u64,
expected: Uuid,
got: Uuid,
},
BackgroundWriterSend(String),
BackgroundWriterJoin(String),
RecordHashMismatch {
seq: u64,
expected: String,
computed: String,
},
HashChainBreak {
seq: u64,
prev_hash: Option<String>,
expected: Option<String>,
},
}Expand description
Errors that can occur during journal I/O (write, read, encode/decode).
Variants§
Io(Error)
Underlying I/O error.
Serialize(String)
Serialization failure.
Deserialize(String)
Deserialization failure.
SeqGap
Non-contiguous sequence number detected during read.
DuplicateEventId(Uuid)
Duplicate event_id detected during read.
TruncatedRecord
Frame is shorter than declared length (file truncated mid-record).
UnsupportedSchemaVersion(u16)
Journal event has a schema version this binary does not support.
PayloadTooLarge
Encoded payload exceeds the 4-byte length prefix maximum (u32::MAX).
NoValidFrames
Non-empty journal file has no decodable frames (e.g. encoding mismatch).
RunIdMismatch
Existing journal run_id does not match the writer run_id.
InconsistentRunId
Existing journal contains multiple run_ids across records.
BackgroundWriterSend(String)
Background writer thread has disconnected or the channel is full.
BackgroundWriterJoin(String)
Background writer thread returned an I/O error.
RecordHashMismatch
Record hash does not match recomputed hash.
HashChainBreak
Hash chain linkage is broken (prev_record_hash does not match previous record).