Skip to main content

FormatError

Enum FormatError 

Source
pub enum FormatError {
Show 21 variants BadMagic { got: [u8; 4], }, TruncatedHeader { got: usize, expected: usize, }, UnsupportedVersion { major: u16, minor: u16, }, TruncatedSuperblock { got: usize, expected: usize, }, BadSuperblockMagic { got: [u8; 4], }, BadSuperblockChecksum, TruncatedSegmentHeader { got: usize, expected: usize, }, BadSegmentMagic { got: [u8; 4], }, BadSegmentHeaderChecksum, BadSegmentPayloadChecksum, SegmentPayloadPastEof, InvalidCatalogPayload { message: String, }, TruncatedRecordPayload, RecordPayloadTypeMismatch, InvalidRecordUtf8, RecordPayloadUnsupportedType, UnknownRecordPayloadVersion { got: u16, }, TrailingRecordPayload, InvalidTxnPayload { message: String, }, InvalidCheckpointPayload { message: String, }, UncleanLogTail { safe_end: u64, reason: &'static str, },
}
Expand description

Low-level decode/validation failures for bytes read from the store.

Variants§

§

BadMagic

File magic was not TDB0.

Fields

§got: [u8; 4]
§

TruncatedHeader

Fewer bytes than expected for a fixed-size header region.

Fields

§got: usize
§expected: usize
§

UnsupportedVersion

Header or manifest reported an unsupported format or manifest version.

Fields

§major: u16
§minor: u16
§

TruncatedSuperblock

Superblock slice shorter than [crate::superblock::SUPERBLOCK_SIZE].

Fields

§got: usize
§expected: usize
§

BadSuperblockMagic

Superblock magic was not TSB0.

Fields

§got: [u8; 4]
§

BadSuperblockChecksum

Superblock CRC did not match payload.

§

TruncatedSegmentHeader

Segment header slice shorter than expected.

Fields

§got: usize
§expected: usize
§

BadSegmentMagic

Segment header magic was not TSG0.

Fields

§got: [u8; 4]
§

BadSegmentHeaderChecksum

Header CRC32C did not match header bytes.

§

BadSegmentPayloadChecksum

Payload CRC32C did not match segment body.

§

SegmentPayloadPastEof

Declared payload length would extend past the file end.

§

InvalidCatalogPayload

Invalid catalog segment payload (binary layout).

Fields

§message: String
§

TruncatedRecordPayload

Record segment payload truncated or malformed.

§

RecordPayloadTypeMismatch

Record payload type tag did not match schema.

§

InvalidRecordUtf8

UTF-8 in a record string field was invalid.

§

RecordPayloadUnsupportedType

Record payload used a composite type not supported in v1 row encoding.

§

UnknownRecordPayloadVersion

Record payload version not supported.

Fields

§got: u16
§

TrailingRecordPayload

Extra bytes after a decoded record payload.

§

InvalidTxnPayload

Transaction marker segment payload was malformed.

Fields

§message: String
§

InvalidCheckpointPayload

Checkpoint payload references a replay offset before the checkpoint segment end.

Fields

§message: String
§

UncleanLogTail

On-disk log ends with an incomplete transaction or torn write; strict open refuses to modify.

Fields

§safe_end: u64

First byte offset that may be discarded to reach a committed prefix (truncate target).

§reason: &'static str

Trait Implementations§

Source§

impl Debug for FormatError

Source§

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

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

impl Display for FormatError

Source§

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

Formats the value using the given formatter. 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<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.