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 inbytes.read()
andbytes.write()
when offset exceeded slice's length.Error::BadInput
andError::Incomplete
should only raised intry_read()
andtry_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
Incomplete
The requested data is bigger than available range
BadOffset(usize)
The offset is invalid
BadInput
The requested data content is invalid
Fields of BadInput
err: &'static str |
Trait Implementations
impl Debug for Error
[src]
impl PartialEq for Error
[src]
fn eq(&self, __arg_0: &Error) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Error) -> bool
[src]
This method tests for !=
.