Enum byte::Error [] [src]

pub enum Error {
    Incomplete,
    BadOffset(usize),
    BadInput {
        err: &'static str,
    },
}

The error type for serializing and deserializing.

  • Error::BadOffset can only be raised by slice.read() and slice.write() when offset is bigger than byte slice's length.

  • Error::BadInput and Error::Incomplete should only be raised by try_read() and try_write().

Note that we usually use slice.read() in try_read() which may raises Error::BadOffset inside try_read(), so SliceExt will automatically translate Error::BadOffset inside try_read() into Error::Incomplete. (same as write)

Variants

The requested data is bigger than available range

The offset is invalid

The requested data content is invalid

Fields of BadInput

Trait Implementations

impl Debug for Error
[src]

Formats the value using the given formatter.

impl PartialEq for Error
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Eq for Error
[src]

impl Copy for Error
[src]

impl Clone for Error
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more