pub enum Error {
Show 22 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),
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.
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).
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).
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.
Internal(&'static str)
Internal invariant violation (a bug in this library).
Trait Implementations§
impl Eq for Error
Source§impl Error for Error
impl Error for Error
1.30.0 · 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()