pub enum DecodeError {
FrameTooLarge {
body: usize,
max: usize,
},
Rmp(Error),
KeepAlive,
}Expand description
Errors from the sync decoder.
Variants§
FrameTooLarge
The length prefix declared a body larger than the caller’s cap. Raised before any body allocation (WIRE-021).
Rmp(Error)
Well-formed frame, malformed MessagePack payload (WIRE-023).
KeepAlive
A zero-length frame: a valid keep-alive carrying no body (WIRE-024), reached through a typed decode that needs one.
Distinct from DecodeError::Rmp on purpose. A zero-length body
genuinely cannot be a Request/Response, but it is not malformed —
it is a liveness tick a peer deliberately sent. Callers match on the
intent and skip it; before this variant existed they had to recognize
it as a parse failure, which is why products wrapped the reader to eat
zero-length frames before delegating.
decode_frame_raw returns these as an empty body instead.
Trait Implementations§
Source§impl Debug for DecodeError
impl Debug for DecodeError
Source§impl Display for DecodeError
impl Display for DecodeError
Source§impl Error for DecodeError
impl Error for DecodeError
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()