#[repr(u8)]pub enum Error {
OUT_OF_SPACE = 0,
TRUNCATED = 1,
INVALID_ADDITIONAL_INFO = 2,
INTEGER_OUT_OF_RANGE = 3,
TYPE_MISMATCH = 4,
INVALID_UTF8 = 5,
INVALID_SIMPLE = 6,
FLOAT_UNSUPPORTED = 7,
DEPTH_EXCEEDED = 8,
UNEXPECTED_BREAK = 9,
INDEFINITE_UNSUPPORTED = 10,
NOT_CANONICAL = 11,
}Expand description
A CBOR processing failure, represented as a compact numeric code.
Variant names use SCREAMING_CASE because they behave like named
constants: each is a stable, single-byte protocol-level code.
Variants§
OUT_OF_SPACE = 0
Output buffer had insufficient space for the encoded item.
TRUNCATED = 1
Input ended before the current item was complete.
INVALID_ADDITIONAL_INFO = 2
Initial byte encodes an additional-information value reserved for
indefinite lengths or future use (28–30), or a 64-bit argument on a
platform narrower than u64.
INTEGER_OUT_OF_RANGE = 3
Value did not fit the requested Rust integer type.
TYPE_MISMATCH = 4
Encountered item type differs from the expected type.
INVALID_UTF8 = 5
Text string payload is not valid UTF-8 (RFC 3629).
INVALID_SIMPLE = 6
Two-byte simple-value encoding used for a value below 32 (RFC 8949 §3.3 forbids this form).
FLOAT_UNSUPPORTED = 7
Floating-point support is disabled (float feature off) but the
item is major type 7 with a floating-point representation.
DEPTH_EXCEEDED = 8
A skipped structure nested deeper than crate::decode::SKIP_LIMIT.
UNEXPECTED_BREAK = 9
A break byte appeared where no indefinite item was open.
INDEFINITE_UNSUPPORTED = 10
Indefinite-length support is disabled (indefinite feature off).
NOT_CANONICAL = 11
Item violates RFC 8949 section 4.2 preferred/deterministic
serialization: non-minimal argument width, non-shortest float,
indefinite length, unsorted or duplicate map keys, or a non-preferred
bignum. Produced only by [crate::deterministic] (deterministic
feature); ordinary decoding accepts all well-formed forms.
Implementations§
Trait Implementations§
impl Copy for Error
impl Eq for Error
Source§impl Error for Error
impl Error for Error
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()