pub enum ProtocolError {
Io(Error),
FrameTooLarge {
actual: usize,
maximum: usize,
},
UnsupportedVersion(u8),
InvalidMagic,
UnknownFrameKind(u8),
UnknownEnum {
name: &'static str,
value: u8,
},
Truncated(&'static str),
InvalidUtf8(&'static str),
InvalidDestination,
FieldTooLong {
field: &'static str,
actual: usize,
maximum: usize,
},
TrailingBytes(usize),
LengthOverflow,
}Expand description
Failures raised while encoding or decoding an SDK–Gateway frame.
Variants§
Io(Error)
The underlying transport failed while a frame was being read or written.
FrameTooLarge
A frame payload is longer than the codec’s configured maximum.
Fields
UnsupportedVersion(u8)
The frame header names a protocol version this codec does not implement.
InvalidMagic
The frame header does not begin with the expected magic bytes.
UnknownFrameKind(u8)
The header kind byte does not name a frame in this protocol version.
UnknownEnum
A byte-valued enum field carries a value outside the contract.
Fields
Truncated(&'static str)
The payload ended before the named field was complete.
InvalidUtf8(&'static str)
The named string field is not valid UTF-8.
InvalidDestination
The decoded namespace and name do not form a valid Destination.
FieldTooLong
A length-prefixed field is longer than the wire format allows.
Fields
TrailingBytes(usize)
The payload held bytes left over after the frame was decoded.
LengthOverflow
A frame length cannot be represented on the wire, or a decode offset would overflow.
Trait Implementations§
Source§impl Debug for ProtocolError
impl Debug for ProtocolError
Source§impl Display for ProtocolError
impl Display for ProtocolError
Source§impl Error for ProtocolError
impl Error for ProtocolError
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()