Enum cbor_event::Error
source · [−]pub enum Error {
Show 22 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,
InvalidIndefiniteString,
InvalidLenPassed(Sz),
InvalidNint(i128),
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
InvalidIndefiniteString
InvalidLenPassed(Sz)
InvalidNint(i128)
CustomError(String)
Trait Implementations
sourceimpl Error for Error
impl Error for Error
sourcefn 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 · sourcefn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
sourcefn backtrace(&self) -> Option<&Backtrace>
fn backtrace(&self) -> Option<&Backtrace>
🔬 This is a nightly-only experimental API. (
backtrace)Returns a stack backtrace, if available, of where this error occurred. Read more
1.0.0 · sourcefn description(&self) -> &str
fn description(&self) -> &str
👎 Deprecated since 1.42.0:
use the Display impl or to_string()
sourceimpl From<FromUtf8Error> for Error
impl From<FromUtf8Error> for Error
sourcefn from(e: FromUtf8Error) -> Self
fn from(e: FromUtf8Error) -> Self
Converts to this type from the input type.
Auto Trait Implementations
impl !RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl !UnwindSafe for Error
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more