Enum byte::Error [] [src]

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

The error type for serializing and deserializing.

  • Error::BadOffset should only raised in bytes.read() and bytes.write() when offset exceeded slice's length.

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

Note that we usually use bytes.read() in try_read() implementation which may raises Error::BadOffset, and that error will automatically be translate into Error::Incomplete.

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]

[src]

Formats the value using the given formatter.

impl PartialEq for Error
[src]

[src]

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

[src]

This method tests for !=.

impl Eq for Error
[src]

impl Copy for Error
[src]

impl Clone for Error
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more