#[non_exhaustive]pub enum DecodeError {
UnexpectedEof {
needed: usize,
available: usize,
field: Field,
},
ReservedFlags(u16),
InvalidStatus(u8),
PayloadOnFailedStatus {
status: PlaintextStatus,
len: usize,
},
TrailingBytes(usize),
}Expand description
Why an envelope could not be decoded.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
UnexpectedEof
The buffer ended before a field could be read in full.
Fields
ReservedFlags(u16)
A reserved flag bit was set. Reserved bits must be zero so that a future contract version can assign meaning to them without silently changing how an older decoder behaves.
InvalidStatus(u8)
The status byte of a plaintext entry is not a value this contract version defines.
PayloadOnFailedStatus
A plaintext entry carries a payload under a status that defines none.
Only PlaintextStatus::Ok describes usable bytes. Bytes under any
other status have no defined meaning, and reading them as plaintext
would be reading whatever the producer happened to leave there.
Fields
status: PlaintextStatusThe status the entry declared.
TrailingBytes(usize)
The envelope decoded correctly but bytes remain. A trailing tail means the producer and consumer disagree about the layout, which is a fault even though the prefix parsed.
Trait Implementations§
Source§impl Clone for DecodeError
impl Clone for DecodeError
impl Copy for DecodeError
Source§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()