pub enum DecodeError {
TrailingBytes,
BadKey,
DuplicateKey,
InvalidText,
NestingTooDeep,
IntegerOutOfRange,
TooManyElements,
Malformed,
}Expand description
Why decode refused an input: one variant for each reason macula’s
reference decoder (macula_record_cbor:decode_strict/1) gives, so an input
is refused for the same reason in every stack.
Variants§
TrailingBytes
Bytes after the top-level value.
BadKey
A map key that is neither text nor an integer.
DuplicateKey
A map key equal to an earlier key of its map: text with the same bytes, or an integer of the same value, in any width.
InvalidText
Text that is not valid UTF-8.
NestingTooDeep
Arrays and maps nested more than MAX_NESTING_DEPTH levels.
IntegerOutOfRange
An integer below -2^63 or above 2^63-1.
TooManyElements
Input that holds more than MAX_ELEMENTS items.
Malformed
Input that is not one complete item of what the rule allows: truncated input, an indefinite length, a tag, a simple value other than null, or a float that is NaN or infinite.
Trait Implementations§
Source§impl Clone for DecodeError
impl Clone for DecodeError
impl Copy for DecodeError
Source§impl Debug for DecodeError
impl Debug for DecodeError
Source§impl Display for DecodeError
impl Display for DecodeError
impl Eq for DecodeError
Source§impl Error for DecodeError
impl Error for DecodeError
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()