Enum PayloadDecodeError
#[non_exhaustive]pub enum PayloadDecodeError {
UnexpectedEnd,
VarIntTooLong,
NegativeLength {
length: i32,
},
LengthOverLimit {
length: u32,
limit: u32,
},
Utf8,
TooDeep,
InvalidDiscriminant {
value: i32,
},
NonFinite,
BudgetExhausted,
Trailing {
bytes: u64,
},
InvalidValue,
}Expand description
Why a payload body is not a value of its type. The value is dropped and its handler does not run.
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.
UnexpectedEnd
The body ends inside a value.
VarIntTooLong
A VarInt of more than 5 bytes, or a VarLong of more than 10.
NegativeLength
A length or count below zero.
LengthOverLimit
A length or count past its bound.
Utf8
A string that is not UTF-8.
TooDeep
Values nested deeper than PAYLOAD_MAX_DEPTH.
InvalidDiscriminant
A boolean, option or enum tag its type does not have.
NonFinite
A number that must be finite is NaN or infinite.
BudgetExhausted
The value would allocate past the reader’s budget.
Trailing
Bytes left over after the value.
InvalidValue
A value its own codec refuses (a number outside its domain, an unknown id).
Trait Implementations§
§impl Clone for PayloadDecodeError
impl Clone for PayloadDecodeError
§fn clone(&self) -> PayloadDecodeError
fn clone(&self) -> PayloadDecodeError
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for PayloadDecodeError
§impl Debug for PayloadDecodeError
impl Debug for PayloadDecodeError
impl Eq for PayloadDecodeError
§impl Hash for PayloadDecodeError
impl Hash for PayloadDecodeError
§impl PartialEq for PayloadDecodeError
impl PartialEq for PayloadDecodeError
impl StructuralPartialEq for PayloadDecodeError
Auto Trait Implementations§
impl Freeze for PayloadDecodeError
impl RefUnwindSafe for PayloadDecodeError
impl Send for PayloadDecodeError
impl Sync for PayloadDecodeError
impl Unpin for PayloadDecodeError
impl UnsafeUnpin for PayloadDecodeError
impl UnwindSafe for PayloadDecodeError
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