#[non_exhaustive]pub enum BlockVerifyError {
SstFileUnreadable {
table_id: TableId,
path: PathBuf,
error: Error,
},
HeaderCorrupted {
table_id: TableId,
path: PathBuf,
offset: u64,
reason: String,
},
DataCorrupted {
table_id: TableId,
path: PathBuf,
offset: u64,
data_length: u32,
expected: Checksum,
got: Checksum,
},
DataReadError {
table_id: TableId,
path: PathBuf,
offset: u64,
data_length: u32,
error: Error,
},
TocCorrupted {
table_id: TableId,
path: PathBuf,
section_name: Vec<u8>,
section_offset: u64,
reason: String,
},
}Expand description
Per-block verification error.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
SstFileUnreadable
SST file could not be opened or its trailer parsed.
Fields
table_id: TableIdTable ID.
HeaderCorrupted
A block header at the given offset failed to parse — either XXH3 mismatch on the header itself, or invalid magic bytes / length fields that point at on-disk corruption.
Fields
table_id: TableIdTable ID.
DataCorrupted
A block’s data XXH3 did not match the value stored in its header. Indicates bit-rot or torn write on the block payload.
Fields
table_id: TableIdTable ID.
expected: ChecksumChecksum stored in the block header.
got: ChecksumChecksum computed from the on-disk bytes.
DataReadError
The block header was successfully decoded (its own XXH3
matched) but the subsequent fixed-length read of the data
segment failed at the filesystem layer — truncated file,
unexpected EOF, transient I/O error. Distinct from
HeaderCorrupted because the header itself was clean: the
failure is on the bytes that should follow it.
Fields
table_id: TableIdTable ID.
TocCorrupted
SFA TOC-level corruption: a named section’s length / position
fields are inconsistent (overflow on addition), or seeking to
its declared start offset fails before any block is read.
Distinct from HeaderCorrupted (which is per-block) so
callers can tell “the section catalogue itself is bad” apart
from “block N inside an otherwise-walkable section is bad” —
e.g. a TocCorrupted makes the whole section unreachable,
while a HeaderCorrupted only stops that section’s walk.
Fields
table_id: TableIdTable ID.
section_name: Vec<u8>Section name from the TOC entry (e.g. b"data",
b"tli"). Stored verbatim, not lossy-decoded, because
SFA section names are byte strings.
Trait Implementations§
Source§impl Debug for BlockVerifyError
impl Debug for BlockVerifyError
Source§impl Display for BlockVerifyError
impl Display for BlockVerifyError
Source§impl Error for BlockVerifyError
impl Error for BlockVerifyError
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()
Auto Trait Implementations§
impl Freeze for BlockVerifyError
impl RefUnwindSafe for BlockVerifyError
impl Send for BlockVerifyError
impl Sync for BlockVerifyError
impl Unpin for BlockVerifyError
impl UnsafeUnpin for BlockVerifyError
impl UnwindSafe for BlockVerifyError
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more