#[non_exhaustive]pub enum ErrorKind {
UnexpectedEob {
requested: usize,
remaining: usize,
},
InvalidReservation {
buffer_len: usize,
reserved_range: Range<usize>,
},
AllocationError(TryReserveError),
AllocationLimitReached {
requested: usize,
remaining: usize,
},
InvalidData(InvalidDataErrorKind),
}Expand description
A list that specifies all the kinds of errors that can be returned by this crate’s functions.
It is typically held by an Error.
This list may grow over time, so it is not recommended to exhaustively match against it.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
UnexpectedEob
A function attempted to read past the end of a buffer.
Fields
InvalidReservation
A buffer reservation did not fit within its buffer.
This error represents a serious problem in the implementation, or intentional tampering by callers.
See write_bytes_exact_into_reserved.
Fields
AllocationError(TryReserveError)
The system failed to allocate memory.
Unlike ErrorKind::AllocationLimitReached,
Most probably, this happened when a decoder attempted to allocate space for a string or collection.
AllocationLimitReached
Hello
InvalidData(InvalidDataErrorKind)
Trait Implementations§
Source§impl From<InvalidDataErrorKind> for ErrorKind
impl From<InvalidDataErrorKind> for ErrorKind
Source§fn from(value: InvalidDataErrorKind) -> Self
fn from(value: InvalidDataErrorKind) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for ErrorKind
impl RefUnwindSafe for ErrorKind
impl Send for ErrorKind
impl Sync for ErrorKind
impl Unpin for ErrorKind
impl UnsafeUnpin for ErrorKind
impl UnwindSafe for ErrorKind
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more