pub enum DecodeError {
Truncated {
needed: usize,
available: usize,
},
ArrayTooLarge {
kind: &'static str,
count: usize,
limit: usize,
},
CountExceedsBuffer {
count: usize,
min_bytes: usize,
available: usize,
},
MessageTooLarge {
total: usize,
limit: usize,
},
UnexpectedSegment {
flags: u8,
},
SegmentInterrupted {
expected: u8,
got: u8,
},
SegmentCommandMismatch {
expected: u8,
got: u8,
},
UnknownTypeTag(u8),
UnresolvedTypeId(u16),
UnknownUnionSelector {
selector: usize,
len: usize,
},
Malformed(&'static str),
}Expand description
Everything that can go wrong decoding a PVA frame or a PVD value.
Replaces the bare None the decoders used to return, which could not
distinguish “buffer ran out” from “this array is implausibly large”.
Variants§
Truncated
The buffer ended before the field did.
ArrayTooLarge
An array’s element count exceeds the configured DecodeLimits entry.
CountExceedsBuffer
An array’s element count cannot fit in the bytes that remain, so the count itself is corrupt. Caught before allocating.
MessageTooLarge
Reassembly exceeded SegmentReassembler’s byte cap.
UnexpectedSegment
A middle or last segment arrived with no message in progress, or a first segment arrived while one was already in progress.
SegmentInterrupted
An unsegmented application message arrived mid-reassembly.
SegmentCommandMismatch
Segments of one message disagree on command byte or direction.
UnknownTypeTag(u8)
An introspection tag byte we do not recognise.
UnresolvedTypeId(u16)
A 0xFE “only id” reference with no matching cached type. Usually
means the PvdDecoder was not reused across the connection.
UnknownUnionSelector
A union selector outside the union’s field list.
Malformed(&'static str)
Structurally invalid input that needs no parameters to explain.
Trait Implementations§
Source§impl Clone for DecodeError
impl Clone for DecodeError
Source§fn clone(&self) -> DecodeError
fn clone(&self) -> DecodeError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DecodeError
impl Debug for DecodeError
Source§impl Display for DecodeError
impl Display for DecodeError
impl Eq for DecodeError
Source§impl Error for DecodeError
impl Error for DecodeError
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()