pub enum DecodeError {
InputTooLarge,
TrailingBytes,
DecoderOverread,
Malformed,
ListTooLong,
NestingTooDeep,
AllocationExceeded,
}Expand description
Shared decode failure categories.
Variants§
InputTooLarge
The byte input is larger than the active decode budget.
TrailingBytes
The input contains trailing bytes after a decoded value.
DecoderOverread
A decoder reported consuming more bytes than the input contains.
Malformed
The input is malformed for the selected wire format.
ListTooLong
A decoded list contains more items than the active decode budget.
NestingTooDeep
Decoding exceeded the active nesting-depth budget.
AllocationExceeded
A decoder requested allocation beyond the active allocation budget.
Implementations§
Source§impl DecodeError
impl DecodeError
Sourcepub const fn category(self) -> DecodeErrorCategory
pub const fn category(self) -> DecodeErrorCategory
Stable high-level category for policy decisions.
Sourcepub const fn resource(self) -> Option<ResourceError>
pub const fn resource(self) -> Option<ResourceError>
Returns the resource budget that was exceeded, if this is a resource exhaustion error.
Trait Implementations§
Source§impl Clone for DecodeError
impl Clone for DecodeError
Source§fn clone(&self) -> DecodeError
fn clone(&self) -> DecodeError
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 DecodeError
Source§impl Debug for DecodeError
impl Debug for DecodeError
Source§impl Display for DecodeError
impl Display for DecodeError
impl Eq for DecodeError
Source§impl PartialEq for DecodeError
impl PartialEq for DecodeError
Source§fn eq(&self, other: &DecodeError) -> bool
fn eq(&self, other: &DecodeError) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for DecodeError
Auto Trait Implementations§
impl Freeze for DecodeError
impl RefUnwindSafe for DecodeError
impl Send for DecodeError
impl Sync for DecodeError
impl Unpin for DecodeError
impl UnsafeUnpin for DecodeError
impl UnwindSafe for DecodeError
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