Enum CodecError
#[non_exhaustive]pub enum CodecError {
UnsupportedVersion(WireError),
#[non_exhaustive] Malformed {
route: Route,
cause: PostcardError,
},
#[non_exhaustive] TrailingBytes {
route: Route,
extra: usize,
},
#[non_exhaustive] Unencodable {
route: Route,
cause: PostcardError,
},
}Expand description
Why envelope bytes could not be read or written.
Every arm is Stop. The same bytes fail the same way
on every retry, and the remedy — an upgrade on one side, or a fix to the
transport that mangled the buffer — is an operator’s.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
UnsupportedVersion(WireError)
The sender stamped a format version this build does not speak, and nothing past the version was decoded.
#[non_exhaustive]Malformed
The bytes are not a postcard envelope holding the message route
carries. A mis-routed buffer can land here, or can decode silently as
the wrong message (ADR-0097 §1): routing is the transport’s to get right.
Fields
This variant is marked as non-exhaustive
cause: PostcardErrorWhat the decoder said.
#[non_exhaustive]TrailingBytes
A whole envelope decoded and bytes were left over. Refused rather than ignored: a buffer that carries more than one message is a transport that framed it wrong, and whatever the extra bytes were is lost.
Fields
This variant is marked as non-exhaustive
#[non_exhaustive]Unencodable
A message could not be encoded.
Fields
This variant is marked as non-exhaustive
cause: PostcardErrorWhat the encoder said.
Trait Implementations§
§impl Classify for CodecError
impl Classify for CodecError
§fn class(&self) -> FailureClass
fn class(&self) -> FailureClass
§impl Clone for CodecError
impl Clone for CodecError
§impl Debug for CodecError
impl Debug for CodecError
§impl Display for CodecError
impl Display for CodecError
impl Eq for CodecError
§impl Error for CodecError
impl Error for CodecError
§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()