#[non_exhaustive]pub enum EncodeErrorKind {
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
Represents the different kinds of errors that can occur during encoding operations.
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
Indicates that there were not enough bytes to complete the encoding operation.
Fields
InvalidField
Indicates that a field in the data being encoded is invalid.
Fields
UnexpectedMessageType
Indicates that an unexpected message type was encountered during encoding.
UnsupportedVersion
Indicates that an unsupported version was encountered during encoding.
UnsupportedValue
Indicates that an unsupported value was encountered during encoding (no-alloc version).
Other
Represents any other error that doesn’t fit into the above categories.
Trait Implementations§
Source§impl Clone for EncodeErrorKind
impl Clone for EncodeErrorKind
Source§fn clone(&self) -> EncodeErrorKind
fn clone(&self) -> EncodeErrorKind
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 EncodeErrorKind
impl Debug for EncodeErrorKind
Auto Trait Implementations§
impl Freeze for EncodeErrorKind
impl RefUnwindSafe for EncodeErrorKind
impl Send for EncodeErrorKind
impl Sync for EncodeErrorKind
impl Unpin for EncodeErrorKind
impl UnwindSafe for EncodeErrorKind
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