#[non_exhaustive]pub enum DecodeErrorKind {
NotEnoughBytes {
received: usize,
expected: usize,
},
InvalidField {
field: &'static str,
reason: &'static str,
},
UnexpectedMessageType {
got: u8,
},
UnsupportedVersion {
got: u8,
},
UnsupportedValue {
name: &'static str,
},
Other {
description: &'static str,
},
}
Expand description
Enum representing different kinds of decode errors.
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.
NotEnoughBytes
Error when there are not enough bytes to decode.
InvalidField
Error when a field is invalid.
UnexpectedMessageType
Error when an unexpected message type is encountered.
UnsupportedVersion
Error when an unsupported version is encountered.
UnsupportedValue
Error when an unsupported value is encountered (without allocation feature).
Other
Generic error for other cases.
Trait Implementations§
Source§impl Clone for DecodeErrorKind
impl Clone for DecodeErrorKind
Source§fn clone(&self) -> DecodeErrorKind
fn clone(&self) -> DecodeErrorKind
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for DecodeErrorKind
impl Debug for DecodeErrorKind
Auto Trait Implementations§
impl Freeze for DecodeErrorKind
impl RefUnwindSafe for DecodeErrorKind
impl Send for DecodeErrorKind
impl Sync for DecodeErrorKind
impl Unpin for DecodeErrorKind
impl UnwindSafe for DecodeErrorKind
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