#[non_exhaustive]pub enum Error {
Io {
context: &'static str,
source: Error,
},
Corruption {
reason: &'static str,
},
}std only.Expand description
Everything that can go wrong while opening, reading from, writing to, or
flushing an Lsm engine.
The type is
#[non_exhaustive]:
future versions may add variants without a major bump, so a match over it
must include a wildcard arm.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Io
An underlying I/O operation failed.
context names the operation that was attempted (for example
"open database directory" or "flush memtable to disk") so the
message is actionable without a backtrace. The original io::Error is
preserved as the source; inspect it when
the OS error kind (disk full, permission denied, not found) drives the
recovery decision.
Fields
Corruption
An on-disk sorted run (SSTable) is not intact.
Either a length prefix is implausibly large, or the file ends in the
middle of a record. A damaged run cannot be trusted, so the read that
touched it fails rather than returning partial or fabricated data.
reason is a short, human-readable description of the inconsistency.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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()
Source§impl ForgeError for Error
impl ForgeError for Error
Source§fn is_fatal(&self) -> bool
fn is_fatal(&self) -> bool
Corruption is unrecoverable by retry: the bytes on disk are already
damaged. I/O errors are left non-fatal for the caller to judge — a
transient Interrupted or a recoverable WouldBlock may be retried.