pub enum StorageError {
Show 15 variants
WriteError,
Io(Error),
UnexpectedEof,
CorruptedRecord,
TornWrite {
reason: String,
},
InvalidRecordKind {
byte: u8,
offset: Offset,
},
ChainVerificationFailed {
offset: Offset,
expected: Option<ChainHash>,
actual: Option<ChainHash>,
},
InvalidCheckpointPayload {
offset: Offset,
reason: String,
},
InvalidIndexMagic,
UnsupportedIndexVersion(u8),
IndexChecksumMismatch {
expected: u32,
actual: u32,
},
IndexTruncated {
expected: usize,
actual: usize,
},
CompressionFailed {
codec: &'static str,
reason: String,
},
DecompressionFailed {
codec: &'static str,
reason: String,
},
InvalidCompressionKind {
byte: u8,
offset: Offset,
},
}Expand description
Errors that can occur during storage operations.
Variants§
WriteError
Generic write error.
Io(Error)
Filesystem I/O error.
UnexpectedEof
The data was truncated (not enough bytes).
CorruptedRecord
CRC mismatch - the record data is corrupted.
TornWrite
Torn write detected - record was incompletely written (AUDIT-2026-03 M-8).
This occurs when power loss or crash happens during a write operation, leaving a record with missing or corrupted sentinel markers.
InvalidRecordKind
Invalid record kind byte.
ChainVerificationFailed
Hash chain verification failed.
InvalidCheckpointPayload
Checkpoint payload is malformed.
InvalidIndexMagic
Index file has invalid magic bytes
UnsupportedIndexVersion(u8)
Index file has unsupported version
IndexChecksumMismatch
Index file checksum mismatch
IndexTruncated
Index file is truncated
CompressionFailed
Compression failed.
DecompressionFailed
Decompression failed.
InvalidCompressionKind
Invalid compression kind byte.
Trait Implementations§
Source§impl Debug for StorageError
impl Debug for StorageError
Source§impl Display for StorageError
impl Display for StorageError
Source§impl Error for StorageError
impl Error for StorageError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Auto Trait Implementations§
impl Freeze for StorageError
impl !RefUnwindSafe for StorageError
impl Send for StorageError
impl Sync for StorageError
impl Unpin for StorageError
impl UnsafeUnpin for StorageError
impl !UnwindSafe for StorageError
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