pub enum WalError {
Show 13 variants
Io(Error),
ChecksumMismatch {
lsn: u64,
expected: u32,
actual: u32,
},
InvalidMagic {
offset: u64,
expected: u32,
actual: u32,
},
UnsupportedVersion {
version: u16,
supported: u16,
},
UnknownRequiredRecordType {
record_type: u32,
lsn: u64,
},
PayloadTooLarge {
size: usize,
max: usize,
},
Sealed,
AlignmentViolation {
context: &'static str,
required: usize,
actual: usize,
},
LockPoisoned {
context: &'static str,
},
EncryptionError {
detail: String,
},
DwbOffNotOpenable,
CorruptRecord {
lsn: u64,
detail: String,
},
InvalidPayload {
detail: String,
},
}Expand description
Errors produced by the WAL subsystem.
Variants§
Io(Error)
I/O error from the underlying file operations.
ChecksumMismatch
CRC32C checksum mismatch during read/replay.
InvalidMagic
Record header has an invalid magic number — file is corrupted or not a WAL.
UnsupportedVersion
WAL format version is not supported by this binary.
UnknownRequiredRecordType
Unknown required record type encountered during replay. Optional unknown record types are safely skipped.
PayloadTooLarge
Write payload exceeds maximum record size.
Sealed
Attempted to write to a WAL that has been closed or is in error state.
AlignmentViolation
Alignment violation — O_DIRECT requires aligned buffers and offsets.
LockPoisoned
A mutex was poisoned (another thread panicked while holding the lock).
EncryptionError
Encryption or decryption failed.
DwbOffNotOpenable
DoubleWriteBuffer::open was called with DwbMode::Off. Callers
that want the DWB disabled must not call open at all.
CorruptRecord
Record payload failed structural validation (truncation, bad length
prefix, invalid UTF-8, etc.). Distinct from WalError::ChecksumMismatch
— the bytes passed CRC but the payload’s own framing is wrong.
InvalidPayload
Record payload is structurally invalid at parse time, before the surrounding LSN context is known (e.g., anchor payload decoded from a byte slice during unit-level use).
Trait Implementations§
Source§impl Error for WalError
impl Error for WalError
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()