[go: up one dir, main page]

Enum cbor::CborError [] [src]

pub enum CborError {
    Io(Error),
    Decode(ReadError),
    Encode(WriteError),
    AtOffset {
        kind: ReadError,
        offset: usize,
    },
    UnexpectedEOF,
}

Errors that can be produced by a CBOR operation.

Variants

Io(Error)

An error as a result of an underlying IO operation.

Decode(ReadError)

An error from the type based decoder.

Encode(WriteError)

An error from the type based encoder.

AtOffset

An error reading CBOR at a particular offset.

For example, if the data in "additional information" is inconsistent with the major type.

Fields

kind: ReadError

The exact read error.

offset: usize

The byte offset at which the error occurred.

UnexpectedEOF

EOF is found but more bytes were expected to decode the next data item.

EOF is triggered when the underlying reader returns 0 bytes.

Trait Implementations

impl Debug for CborError
[src]

fn fmt(&self, __arg_0: &mut Formatter) -> Result

Formats the value using the given formatter.

impl From<Error> for CborError
[src]

fn from(err: Error) -> CborError

Performs the conversion.

impl From<Error> for CborError
[src]

fn from(err: Error) -> CborError

Performs the conversion.

impl Error for CborError
[src]

fn description(&self) -> &str

A short description of the error. Read more

fn cause(&self) -> Option<&Error>

The lower-level cause of this error, if any. Read more

impl Display for CborError
[src]

fn fmt(&self, f: &mut Formatter) -> Result

Formats the value using the given formatter.