#[non_exhaustive]pub enum CapsuleDecodeError {
Show 13 variants
Truncated {
required: usize,
available: usize,
},
InvalidMagic,
UnsupportedCodec {
major: u16,
minor: u16,
},
NonCanonicalLength {
declared_body_len: u32,
actual_body_len: usize,
},
MissingSection {
tag: u16,
},
SectionOutOfOrder {
tag: u16,
},
UnknownSection {
tag: u16,
},
NonCanonicalSectionLength {
tag: u16,
declared: u32,
},
NonCanonicalSection {
tag: u16,
},
ParticipantOutOfOrder {
participant_id: ParticipantId,
},
ForeignConversation {
tag: u16,
},
TrailingBytes {
trailing: usize,
},
LengthOverflow,
}Expand description
Stable canonical capsule-decode failure.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Truncated
Fewer bytes than the fixed envelope or selected field requires.
Fields
InvalidMagic
The capsule does not begin with the assigned LPCK magic prefix.
UnsupportedCodec
The capsule codec version is not supported by this crate.
NonCanonicalLength
The declared body length differs from the bytes supplied after the fixed header.
Fields
MissingSection
The body ended before a section the canonical order requires.
SectionOutOfOrder
A known section appeared where the canonical order has another.
UnknownSection
A section tag is unassigned.
NonCanonicalSectionLength
A section’s declared length is not its canonical length.
NonCanonicalSection
A complete section violates a field invariant.
ParticipantOutOfOrder
The participants section is not strictly ascending by participant id.
Fields
participant_id: ParticipantIdThe first participant id not above its predecessor.
ForeignConversation
A section names another conversation than the capsule header.
TrailingBytes
Bytes remain after the last canonical section.
LengthOverflow
A platform length conversion or offset addition overflowed.