pub enum CodecError {
Show 16 variants
InvalidLength(u32),
FrameTooLarge(usize),
Truncated {
message_id: u32,
needed: usize,
actual: usize,
},
InvalidDeviceId(String),
InvalidDefinition(String),
InvalidText,
UnsupportedProtocol(u32),
UnexpectedRoute {
message_id: u32,
actual: MessageRoute,
expected: &'static str,
},
InvalidValue {
message_id: u32,
field: &'static str,
value: u64,
},
CountTooLarge {
message_id: u32,
field: &'static str,
count: usize,
maximum: usize,
},
NonZeroPadding {
message_id: u32,
field: &'static str,
},
TrailingBytes {
message_id: u32,
count: usize,
},
InvalidAlignment {
message_id: u32,
actual: usize,
},
TextTooLong {
message_id: u32,
field: &'static str,
actual: usize,
maximum: usize,
},
SecretTooLong {
field: &'static str,
actual: usize,
maximum: usize,
},
Wire {
operation: &'static str,
message_id: u32,
offset: u64,
detail: String,
},
}Expand description
Validation and serialization failures produced by framing and message codecs.
Variants§
InvalidLength(u32)
The header length cannot describe a valid frame.
FrameTooLarge(usize)
The complete frame would exceed MAX_FRAME_SIZE.
Truncated
A fixed or mandatory payload prefix is incomplete.
InvalidDeviceId(String)
A station identifier failed its textual or structural validation.
InvalidDefinition(String)
A runtime device definition violates a message-level constraint.
InvalidText
A wire text field is not valid under the selected text policy.
UnsupportedProtocol(u32)
The requested protocol version is outside the supported range.
UnexpectedRoute
A known message was decoded through the wrong protocol role.
InvalidValue
A scalar field contains a value forbidden by its wire contract.
CountTooLarge
A declared or decoded item count exceeds its bounded capacity.
NonZeroPadding
Reserved bytes in a fixed field are not zero-filled.
TrailingBytes
Bytes remain after decoding a layout that requires exact consumption.
InvalidAlignment
A payload that requires 32-bit alignment has an invalid length.
TextTooLong
A text value exceeds the capacity of its wire field.
SecretTooLong
Secret key material exceeds its fixed wire capacity.
Wire
The binary reader or writer failed at a known wire offset.
Trait Implementations§
Source§impl Clone for CodecError
impl Clone for CodecError
Source§fn clone(&self) -> CodecError
fn clone(&self) -> CodecError
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 CodecError
impl Debug for CodecError
Source§impl Display for CodecError
impl Display for CodecError
impl Eq for CodecError
Source§impl Error for CodecError
impl Error for CodecError
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()