pub enum DecodeError {
UnexpectedEof,
InvalidUtf8,
InvalidVarint,
LimitExceeded {
field: &'static str,
limit: u64,
actual: u64,
},
UnknownEnumVariant {
type_name: &'static str,
value: u64,
},
UnknownUnionVariant {
type_name: &'static str,
discriminant: u64,
},
RemovedField {
ordinal: u16,
removed_in: &'static str,
reason: &'static str,
},
InvalidValue {
field: &'static str,
message: String,
},
RecursionLimitExceeded,
SchemaMismatch {
local: [u8; 32],
remote: [u8; 32],
},
}Expand description
Errors that can occur while decoding (unpacking) a value from wire format.
Variants§
UnexpectedEof
The input ended before all expected fields were read.
InvalidUtf8
A string field contained bytes that are not valid UTF-8.
InvalidVarint
A LEB128 varint was too long or used an overlong encoding.
LimitExceeded
A decoded length or count exceeded its safety limit.
UnknownEnumVariant
The discriminant for an enum did not match any known variant.
UnknownUnionVariant
The discriminant for a union did not match any known variant.
RemovedField
A field that was marked as removed in the schema was encountered.
InvalidValue
A field value was syntactically valid but semantically invalid.
RecursionLimitExceeded
Recursive type nesting exceeded MAX_RECURSION_DEPTH.
SchemaMismatch
The BLAKE3 schema hash in the data did not match the local schema.
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 · 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 DecodeError
impl Debug for DecodeError
Source§impl Display for DecodeError
impl Display for DecodeError
Source§impl Error for DecodeError
impl Error for DecodeError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl PartialEq for DecodeError
impl PartialEq for DecodeError
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