Skip to main content

Error

Enum Error 

Source
#[non_exhaustive]
pub enum Error {
Show 17 variants Io(Error), Decompress(CompressionType), InvalidVersion(u8), Unrecoverable, ChecksumMismatch { got: Checksum, expected: Checksum, }, HeaderCrcMismatch { recomputed: u32, stored: u32, }, InvalidTag((&'static str, u8)), InvalidTrailer, InvalidHeader(&'static str), DecompressedSizeTooLarge { declared: u64, limit: u64, }, Utf8(Utf8Error), MergeOperator, Encrypt(&'static str), Decrypt(&'static str), ComparatorMismatch { stored: String, supplied: &'static str, }, ZstdDictMismatch { expected: u32, got: Option<u32>, }, RangeTombstoneDecode { field: &'static str, offset: u64, },
}
Expand description

Represents errors that can occur in the LSM-tree

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

Io(Error)

I/O error

§

Decompress(CompressionType)

Decompression failed

§

InvalidVersion(u8)

Invalid or unparsable data format version

§

Unrecoverable

Some required files could not be recovered from disk

§

ChecksumMismatch

Checksum mismatch

Fields

§got: Checksum

Checksum of loaded block

§expected: Checksum

Checksum that was saved in block header

§

HeaderCrcMismatch

Blob frame header CRC mismatch (V4 format). Distinct from ChecksumMismatch which covers data payload checksums.

Fields

§recomputed: u32

CRC recomputed from header fields

§stored: u32

CRC stored in the blob frame header

§

InvalidTag((&'static str, u8))

Invalid enum tag

§

InvalidTrailer

Invalid block trailer

§

InvalidHeader(&'static str)

Invalid block header

§

DecompressedSizeTooLarge

Data size (decompressed, on-disk, or requested) is invalid or exceeds a safety limit

Fields

§declared: u64

Size associated with the data being processed. This may come from on-disk/in-memory metadata (e.g., header, block/value handle) or be derived from caller input (e.g., a requested key or value length), and may be zero, invalid, or over the configured limit.

§limit: u64

Maximum allowed size for the data or request being processed

§

Utf8(Utf8Error)

UTF-8 error

§

MergeOperator

Merge operator failed.

No context payload — consistent with other unit variants (Unrecoverable, InvalidTrailer). Operators should log details before returning this error.

§

Encrypt(&'static str)

Encryption failed

§

Decrypt(&'static str)

Decryption failed

§

ComparatorMismatch

Comparator mismatch on tree reopen.

The tree was created with a comparator whose crate::UserComparator::name differs from the one supplied at reopen time.

Fields

§stored: String

Comparator name persisted in the tree metadata.

§supplied: &'static str

Comparator name supplied by the caller.

§

ZstdDictMismatch

Zstd dictionary required but not provided, or dict_id mismatch

Fields

§expected: u32

Dictionary ID stored in the block/table metadata

§got: Option<u32>

Dictionary ID provided by the caller (None if no dictionary supplied)

§

RangeTombstoneDecode

Range tombstone block decode failure.

Fields

§field: &'static str

Which field or validation failed (e.g. start_len, start, seqno, interval)

§offset: u64

Byte offset within the block to the start of the field whose decoding failed (captured before reading bytes for that field).

Trait Implementations§

Source§

impl Debug for Error

Source§

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

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

impl Display for Error

Source§

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

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

impl Error for Error

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

impl From<Error> for Error

Source§

fn from(value: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for Error

Source§

fn from(value: Error) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl Freeze for Error

§

impl !RefUnwindSafe for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl UnsafeUnpin for Error

§

impl !UnwindSafe for Error

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<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> 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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.