pub enum WireError {
Show 14 variants
FrameTooLarge {
len: usize,
},
FrameTruncated {
declared: u32,
actual: usize,
},
ShortHeader {
got: usize,
},
UnexpectedEof,
UnsupportedMajor {
major: u8,
},
UnsupportedAdditional {
additional: u8,
},
NotMap5,
ContentVersionMustBeFirst,
UnsupportedContentVersion(u16),
MissingField(&'static str),
FieldType {
field: &'static str,
got_major: u8,
},
IntegerOverflow {
field: &'static str,
},
UnknownProbeSource(String),
InvalidUtf8 {
field: &'static str,
},
}Expand description
Errors surfaced by the wire encoder/decoder.
Variants§
FrameTooLarge
Frame body exceeded MAX_FRAME_BODY_BYTES.
FrameTruncated
Frame body shorter than the declared length prefix.
Fields
ShortHeader
Length-prefix header itself is shorter than 4 bytes.
UnexpectedEof
CBOR ran past end of buffer.
UnsupportedMajor
CBOR major type is not in the supported subset (0, 3, 5).
UnsupportedAdditional
CBOR additional info encodes indefinite-length or > 8-byte length.
NotMap5
Outer item is not a 5-entry definite map.
ContentVersionMustBeFirst
First map key is not the literal text "content_version" —
host short-circuits unknown majors before walking the rest.
UnsupportedContentVersion(u16)
content_version major is not WIRE_CONTENT_VERSION_MAJOR.
MissingField(&'static str)
Required field missing or duplicated.
FieldType
Field present but wrong CBOR major.
Fields
IntegerOverflow
Integer field overflowed its declared width.
UnknownProbeSource(String)
Probe-source string not in probe_source::ALL.
InvalidUtf8
Text field is not valid UTF-8.
Trait Implementations§
Source§impl Error for WireError
impl Error for WireError
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()