pub enum Error {
Show 47 variants
Magic,
VersionMajor(u16),
VersionMinor(u16),
HeaderTruncated,
HeaderSize(u8),
UnknownFlags(u16),
ReservedNonZero {
section: &'static str,
offset: u64,
},
Offset {
section: &'static str,
offset: u64,
},
Truncated {
needed: u64,
found: u64,
},
TrailingBytes {
at: u64,
},
Count {
field: &'static str,
value: u64,
},
Padding {
offset: u64,
},
HashMismatch,
DialectMismatch(u64),
NotCanonical,
StringRef(u32),
NodeRef(u32),
Node {
id: u32,
reason: &'static str,
},
Utf8 {
offset: u64,
},
UnknownUnit(u32),
UnitRef(u32),
Type {
id: u32,
reason: &'static str,
},
Edge {
from: u32,
to: u32,
},
Annotation {
id: u32,
reason: &'static str,
},
Provenance(&'static str),
Extension {
tag: u64,
reason: &'static str,
},
Blob {
id: u32,
reason: &'static str,
},
SecretEntry(u32),
DuplicateField {
node: u32,
},
DuplicateBinding,
Cycle {
node: u32,
},
Depth {
limit: u32,
},
Limit {
kind: &'static str,
limit: u64,
},
InvalidArgument(&'static str),
Evaluation(&'static str),
Encode(&'static str),
EncodeDangling(u32),
TooLarge,
StreamMagic,
StreamVersion(u8),
StreamFrameLen {
declared: u32,
available: u64,
},
StreamFrameKind(u8),
StreamSequence {
expected: u64,
found: u64,
},
StreamState(&'static str),
StreamHashMismatch,
StreamDelta(&'static str),
StreamUnterminated,
}Expand description
A codec, validation or streaming failure.
Variant documentation states the condition; field names are stable API.
Variants§
Magic
Input does not start with the AINF magic.
VersionMajor(u16)
Unsupported major format version.
VersionMinor(u16)
Unsupported minor format version (readers never guess forward).
HeaderTruncated
Header is shorter than the fixed 160-byte prefix.
HeaderSize(u8)
Header header_size field is not the supported fixed size.
UnknownFlags(u16)
Header flags set bits this reader does not understand.
ReservedNonZero
A reserved header or record field was non-zero.
Offset
A section offset or byte range is out of bounds, misaligned, overlapping, or not in canonical ascending order.
Truncated
The buffer is longer or shorter than the sections it declares.
TrailingBytes
The buffer declares trailing bytes after the final section.
Count
A count field cannot be satisfied by the remaining bytes, or exceeds the configured limits.
Padding
Non-zero padding byte (canonical images pad with zero only).
HashMismatch
Stored content hash does not match the recomputed hash.
DialectMismatch(u64)
The declared dialect hash is not the dialect this reader implements.
NotCanonical
A buffer self-declares canonical form but re-encoding differs.
StringRef(u32)
A string id is out of range.
NodeRef(u32)
A node id is out of range.
Node
A node record violates the per-kind contract.
Utf8
String heap bytes are not valid UTF-8.
UnknownUnit(u32)
A unit discriminant is not one this reader implements.
UnitRef(u32)
A quantity or type reference is out of range.
Type
A type-table entry is malformed.
Edge
An edge endpoint is out of range or an edge is self-referential.
Annotation
An annotation record is malformed.
Provenance(&'static str)
The provenance block is malformed.
Extension
An extension block is malformed or overlaps another block.
Blob
A blob entry is malformed.
SecretEntry(u32)
A secret-table entry is malformed.
DuplicateField
A table field name repeats.
DuplicateBinding
A binding name repeats.
Cycle
A node participates in a dependency cycle.
Depth
Nesting depth exceeds the configured limit while validating.
Limit
A configured decode limit was exceeded.
InvalidArgument(&'static str)
A caller-supplied value is outside its legal range.
Evaluation(&'static str)
The Active evaluator rejected the module; the payload is its stable
diagnostic class (S001, T001, X00n, …).
Encode(&'static str)
A module cannot be encoded (dangling reference, duplicate key, …).
EncodeDangling(u32)
A node id referenced during encoding does not exist.
TooLarge
The encoded image would exceed u32 offset space.
StreamMagic
Stream frame magic AINS missing.
StreamVersion(u8)
Unsupported stream frame version.
StreamFrameLen
A stream frame length exceeds the limit or the available bytes.
StreamFrameKind(u8)
A stream frame kind is unknown.
StreamSequence
A stream frame is out of sequence or the stream is truncated.
StreamState(&'static str)
A frame arrived before Begin or after End.
StreamHashMismatch
The reassembled module hash does not match the End frame.
StreamDelta(&'static str)
A delta operation cannot be applied to the current module state.
StreamUnterminated
The stream ended without an End frame.
Implementations§
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()
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.