[−][src]Enum byte::Error
The error type for byte
crate.
-
Error::BadOffset
will be returned when the offset parameter exceedes slice's length. -
Error::BadInput
andError::Incomplete
will be returned whentry_read()
andtry_write()
finds the bytes is not valid or not long enough to determin whether it's valid.
Note that we usually use bytes.read()
in try_read()
which may returns Error::BadOffset
,
which indicates an incomplete data. So the error will automatically be converted into
Error::Incomplete
if you use bytes.read()
. (same for write()
)
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
Trait Implementations
impl PartialEq<Error> for Error
[src]
impl Eq for Error
[src]
impl Debug for Error
[src]
impl Copy for Error
[src]
impl Clone for Error
[src]
Auto Trait Implementations
Blanket Implementations
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,