#[non_exhaustive]pub enum Error {
Io(Error),
ManifestCorrupt(String),
SstCorrupt(String),
InvalidArgument(String),
Locked(PathBuf),
UnsupportedFormat {
found: u32,
supported: u32,
},
}Expand description
Crate-wide error type. See module docs for the full taxonomy.
#[non_exhaustive]: new variants may be added in a minor (0.x) release; match with a
wildcard arm (_ => ...) rather than exhaustively.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Io(Error)
Underlying filesystem error from std::io.
ManifestCorrupt(String)
Manifest log replay encountered an unknown record kind or a truncated/corrupt record.
A format-version mismatch is reported as Error::UnsupportedFormat instead.
SstCorrupt(String)
SSTable file failed validation on open or during a block read: truncated file, bad
magic/footer offsets, a block that failed its CRC check, or a malformed index/bloom. A
format-version mismatch is reported as Error::UnsupportedFormat instead.
InvalidArgument(String)
A caller-supplied argument violates a documented limit — e.g. a key longer than
crate::wal::MAX_KEY_LEN or a value longer than crate::wal::MAX_VALUE_LEN. Checked
before the op ever reaches the writer thread, so the engine and any other pending writes
are unaffected.
Locked(PathBuf)
Db::open/open_with found <dir>/LOCK already held by another live Db (in this
process or another). Only one open Db per directory is supported: two writers sharing
a WAL/manifest would corrupt each other’s state, and mmap-based WAL replay racing a live
writer could SIGBUS. Close/drop the other Db first.
UnsupportedFormat
Db::open/open_with found a manifest (or SST) written by an on-disk format version
this build doesn’t support. Checked before recovery touches any WAL or SST file, so the
directory is left exactly as found — nothing is deleted or rewritten. Open it with a
driftdb version that supports found instead.
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()