Enum saltpig::error::Error [−][src]
pub enum Error { TypeError(TypeError), LengthExceeded(Major, usize), LengthSubsceeded(Major, usize, usize), ExpectedKey(usize), ExpectedValue(usize), TopLevelAlreadyExists, UnexpectedBreak, UnknownInfo(u8, Major), NoMoreItems, DuplicateKey(OrdValue<'static>), Io(Error), }
Errors produced by encoding or decoding CBOR data.
Variants
TypeError(TypeError)
A value had the wrong type (or wrong length, tag, etc).
LengthExceeded(Major, usize)
During encoding, too many elements were added to a determinate-length collection.
Not to be confused with TypeError::WrongLen
.
LengthSubsceeded(Major, usize, usize)
During encoding, not enough elements were added to a determinate-length collection.
Not to be confused with TypeError::WrongLen
.
ExpectedKey(usize)
An attempt was made to encode a map value when a key should have been encoded.
ExpectedValue(usize)
An attempt was made to encode a map key when a value should have been encoded.
TopLevelAlreadyExists
An attempt was made to encode more than one top-level item.
UnexpectedBreak
During decoding, a break code was encountered in an unexpected position.
UnknownInfo(u8, Major)
During decoding, an unknown additional-information value was encountered.
NoMoreItems
An attempt was made to decode an item from a stream that has no more items.
DuplicateKey(OrdValue<'static>)
During encoding or decoding, a duplicate key was encountered in a map.
Io(Error)
An IO error occurred.
Trait Implementations
impl Debug for Error
[src]
impl Debug for Error
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Error for Error
[src]
impl Error for Error
fn description(&self) -> &'static str
[src]
fn description(&self) -> &'static str
This method is soft-deprecated. Read more
fn cause(&self) -> Option<&Error>
[src]
fn cause(&self) -> Option<&Error>
The lower-level cause of this error, if any. Read more
impl Display for Error
[src]
impl Display for Error
fn fmt(&self, formatter: &mut Formatter) -> Result<(), Error>
[src]
fn fmt(&self, formatter: &mut Formatter) -> Result<(), Error>
Formats the value using the given formatter. Read more
impl From<Error> for Error
[src]
impl From<Error> for Error
impl From<TypeError> for Error
[src]
impl From<TypeError> for Error
impl TryFrom<Error> for TypeError
[src]
impl TryFrom<Error> for TypeError