Skip to main content

Error

Enum Error 

Source
pub enum Error {
Show 29 variants BadMagic, UnsupportedVersion { found: u8, supported: u8, }, MalformedHeader(&'static str), Truncated, OutOfBounds, IndexOutOfBounds, BadUtf8, BadSchema(String), TypeMismatch { expected: String, got: String, }, Incompatible(String), UnknownFieldId(u16), DuplicateField(u16), DuplicateMapKey, BadUnionTag(u32), MissingField(u16), SchemaIdMismatch { message: u128, expected: u128, }, NoInlineSchema, DepthLimitExceeded, TraversalBudgetExceeded, MessageTooLarge, BadContainer(&'static str), BadFile(&'static str), UnsupportedFileFeature(u32), NoValidFooter, MissingSchema(u128), AlreadyLocked(String), ChecksumMismatch { id: u64, expected: u32, found: u32, }, Io(String), Internal(&'static str),
}

Variants§

§

BadMagic

Message does not start with the “VRT” magic family at all — not a Veritate message.

§

UnsupportedVersion

A Veritate message (“VRT” prefix) whose version byte this decoder does not implement. found is the version digit in the magic; supported is what this build understands. Guarantees a vN message can never be silently misread as vM.

Fields

§found: u8
§supported: u8
§

MalformedHeader(&'static str)

The fixed header is structurally invalid for this version: an unknown flag bit, or a reserved field that is not zero.

§

Truncated

Buffer too short for the fixed header or a declared region.

§

OutOfBounds

An offset or length points outside the message buffer.

§

IndexOutOfBounds

List element index past the end of the list.

§

BadUtf8

A string field holds invalid UTF-8.

§

BadSchema(String)

The (inline) schema bytes are malformed or non-canonical.

§

TypeMismatch

A value’s type does not match the schema field type (write path), or a typed getter was used on a differently-typed field (read path).

Fields

§expected: String
§

Incompatible(String)

Writer and reader schema cannot be resolved (e.g. int narrowing).

§

UnknownFieldId(u16)

A value referenced a field ID that is not in the schema.

§

DuplicateField(u16)

The same field ID appeared twice in one struct value.

§

DuplicateMapKey

The same key appeared twice in one map value.

§

BadUnionTag(u32)

A union value or wire tag selected a variant index that does not exist.

§

MissingField(u16)

A dense struct was encoded without one of its (mandatory) fields.

§

SchemaIdMismatch

The message’s schema id does not match the resolver’s writer schema (or the inline schema bytes hash to something else).

Fields

§message: u128
§expected: u128
§

NoInlineSchema

dump_json needs an inline schema but the message was hash-only.

§

DepthLimitExceeded

Recursion (nested structs/lists) exceeded the safety depth limit — the message may contain an offset cycle or hostile nesting.

§

TraversalBudgetExceeded

A bounded read exhausted its traversal budget: the message followed offsets that would touch more bytes than the budget allows (an amplification guard for untrusted input — see Budget / the wire spec §5.2).

§

MessageTooLarge

Message would exceed the 4 GiB u32-offset limit.

§

BadContainer(&'static str)

A .vertc container file is malformed: bad magic/version, an index pointing out of bounds, a misaligned or overlapping record, etc.

§

BadFile(&'static str)

A .verit file is structurally malformed: bad magic or version, a nonzero reserved field, an index entry pointing outside the record region, a misaligned offset, and so on.

§

UnsupportedFileFeature(u32)

The .verit file sets a bit in required_features that this build does not implement, so it cannot be read correctly (File Format Specification §3.1). Unknown optional feature bits are ignored, not reported here.

§

NoValidFooter

No valid footer was found anywhere in a .verit file, so no committed state is recoverable — the file was destroyed, not merely torn.

§

MissingSchema(u128)

A .verit file’s index references a schema id its schema section does not contain, so the file is not self-contained.

§

AlreadyLocked(String)

Another writer already holds this file’s advisory lock. The format allows one writer and many readers (File Format Specification §7.3); concurrent writers are undefined, so this refuses rather than racing. Carries the lock file’s path — delete it by hand if a previous writer was killed.

§

ChecksumMismatch

A record’s bytes do not match the CRC-32 the file stored for it — bit rot, or a tampered record. Only reachable on a file written with per-record checksums (OPT_RECORD_CRC). Names the record’s stable id rather than its position, since positions shift.

Fields

§id: u64

The record’s stable id.

§expected: u32

What the file says the CRC should be.

§found: u32

What the bytes actually hash to.

§

Io(String)

The underlying I/O operation failed. Carried as a string so Error stays Clone + PartialEq (std::io::Error is neither).

§

Internal(&'static str)

Internal invariant violation (a bug in this library).

Trait Implementations§

Source§

impl Clone for Error

Source§

fn clone(&self) -> Error

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
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 Eq for Error

Source§

impl Error for Error

1.30.0 · 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(e: Error) -> Error

Converts to this type from the input type.
Source§

impl PartialEq for Error

Source§

fn eq(&self, other: &Error) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Error

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.