Enum cbor_event::Error
source · pub enum Error {
Show 19 variants
ExpectedU8,
ExpectedU16,
ExpectedU32,
ExpectedU64,
ExpectedI8,
ExpectedI16,
ExpectedI32,
ExpectedI64,
NotEnough(usize, usize),
Expected(Type, Type),
ExpectedSetTag,
UnknownLenType(u8),
IndefiniteLenNotSupported(Type),
WrongLen(u64, Len, &'static str),
InvalidTextError(FromUtf8Error),
CannotParse(Type, Vec<u8>),
IoError(Error),
TrailingData,
CustomError(String),
}
Expand description
all expected error for cbor parsing and serialising
Variants§
ExpectedU8
ExpectedU16
ExpectedU32
ExpectedU64
ExpectedI8
ExpectedI16
ExpectedI32
ExpectedI64
NotEnough(usize, usize)
not enough data, the first element is the actual size, the second is the expected size.
Expected(Type, Type)
Were expecting a different Type
. The first
element is the expected type, the second is the current type.
ExpectedSetTag
UnknownLenType(u8)
this may happens when deserialising a Deserializer
;
IndefiniteLenNotSupported(Type)
WrongLen(u64, Len, &'static str)
InvalidTextError(FromUtf8Error)
CannotParse(Type, Vec<u8>)
IoError(Error)
TrailingData
CustomError(String)
Trait Implementations§
source§impl Error for Error
impl Error for Error
source§fn cause(&self) -> Option<&dyn Error>
fn cause(&self) -> Option<&dyn Error>
👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
source§impl From<FromUtf8Error> for Error
impl From<FromUtf8Error> for Error
source§fn from(e: FromUtf8Error) -> Self
fn from(e: FromUtf8Error) -> Self
Converts to this type from the input type.