Enum byte::Error
[−]
[src]
pub enum Error {
Incomplete,
BadOffset(usize),
BadInput {
err: &'static str,
},
}The error type for serializing and deserializing.
Error::BadOffsetcan only be raised byslice.read()andslice.write()when offset is bigger than byte slice's length.Error::BadInputandError::Incompleteshould only be raised bytry_read()andtry_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
IncompleteThe requested data is bigger than available range
BadOffset(usize)The offset is invalid
BadInputThe 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
This method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, __arg_0: &Error) -> bool
This method tests for !=.
impl Eq for Error[src]
impl Copy for Error[src]
impl Clone for Error[src]
fn clone(&self) -> Error
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0
Performs copy-assignment from source. Read more