Skip to main content

BlockVerifyError

Enum BlockVerifyError 

Source
#[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, }, EccParityMismatch { table_id: TableId, path: PathBuf, offset: u64, data_length: u32, }, 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
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

SstFileUnreadable

SST file could not be opened or its trailer parsed.

Fields

§table_id: TableId

Table ID.

§path: PathBuf

Path to the SST file.

§error: Error

Underlying I/O / format error.

§

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: TableId

Table ID.

§path: PathBuf

Path to the SST file.

§offset: u64

File offset where the corrupt header was read from.

§reason: String

Short description of the failure surfaced by header decoding.

§

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: TableId

Table ID.

§path: PathBuf

Path to the SST file.

§offset: u64

File offset where the block header sits (the data follows it).

§data_length: u32

Length of the on-disk data segment, in bytes.

§expected: Checksum

Checksum stored in the block header.

§got: Checksum

Checksum 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: TableId

Table ID.

§path: PathBuf

Path to the SST file.

§offset: u64

File offset where the (clean) header sits; the read for its data segment started at offset + Header::header_len(block_type).

§data_length: u32

Length the (clean) header advertised for the data segment.

§error: Error

Underlying I/O error from the failed data-segment read. Kept as std::io::Error (matching SstFileUnreadable) so ErrorKind / OS code stay available to callers and so Error::source() produces a coherent chain.

§

EccParityMismatch

A block’s Page-ECC parity trailer did not match parity freshly computed over its (checksum-clean) payload. The payload itself is intact — but the block’s ECC is dead: a later payload fault could no longer be recovered from this trailer. Reported only when the payload checksum matched (a corrupt payload legitimately mismatches the original trailer and is already reported as DataCorrupted).

Fields

§table_id: TableId

Table ID.

§path: PathBuf

Path to the SST file.

§offset: u64

File offset where the block header sits.

§data_length: u32

Length of the on-disk data segment, in bytes.

§

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: TableId

Table ID.

§path: PathBuf

Path to the SST file.

§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.

§section_offset: u64

File offset where the section would start per the TOC entry. Useful for forensics even when the start is unreachable.

§reason: String

Short description of the failure (overflow on start+length, seek error, etc.).

Trait Implementations§

Source§

impl Debug for BlockVerifyError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for BlockVerifyError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for BlockVerifyError

Source§

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

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V