pub enum HeaderError {
Show 14 variants
Malformed(&'static str),
Indefinite,
DuplicateKey(u64),
UnorderedKey(u64),
NonUintKey,
MissingKey(u64),
StringTooLong {
key: u64,
len: usize,
max: usize,
},
ListTooLong {
key: u64,
len: u64,
max: usize,
},
DepthExceeded,
TrailingBytes,
UnknownLevel {
dimension: &'static str,
value: u64,
},
InvalidGuarantees(&'static str),
InvalidFilter(&'static str),
InvalidReport(&'static str),
}Expand description
Why a header was rejected. Every variant is a protocol violation.
Variants§
Malformed(&'static str)
The bytes are not well-formed CBOR, or a value had the wrong type.
Indefinite
An indefinite-length item was used where the protocol forbids it.
DuplicateKey(u64)
A map key appeared twice.
UnorderedKey(u64)
A map key was not greater than the preceding one; keys must ascend.
NonUintKey
A map key was not an unsigned integer.
MissingKey(u64)
A required key was absent.
StringTooLong
A text field exceeded its cap.
ListTooLong
A list field declared more items than the decoder accepts.
Fields
DepthExceeded
An unknown field nested deeper than limits::MAX_SKIP_DEPTH.
TrailingBytes
Bytes remained after the header map.
UnknownLevel
A guarantee set, or a DATA header’s achieved level, named a level this version does not define.
InvalidGuarantees(&'static str)
A guarantee set’s dimension combination is one §6.5 forbids, or a HELLO requires more than it offers (§6.1).
InvalidFilter(&'static str)
A topic filter violated the grammar of docs/PROTOCOL.md §6.4.
InvalidReport(&'static str)
A DATA header’s report order is malformed: the levels do not ascend,
there are too many of them, or the order and its id disagree
(docs/PROTOCOL.md §6.2, keys 9-11).
Trait Implementations§
Source§impl Clone for HeaderError
impl Clone for HeaderError
Source§impl Debug for HeaderError
impl Debug for HeaderError
Source§impl Display for HeaderError
impl Display for HeaderError
impl Eq for HeaderError
Source§impl Error for HeaderError
impl Error for HeaderError
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()