#[non_exhaustive]pub enum DecodeError {
Truncated {
needed: usize,
},
VarintOverflow,
InvalidLength(i64),
InvalidUtf8,
UnknownDiscriminant {
kind: &'static str,
value: i64,
},
CrcMismatch {
stored: u32,
computed: u32,
},
AllocationLimit {
limit: usize,
wanted: usize,
},
AllocationFailed {
bytes: usize,
limit: usize,
},
NoProgress,
TaggedFieldOrder {
previous: u32,
tag: u32,
},
}Expand description
Bytes on the wire could not be decoded.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Truncated
The buffer ended before the value was complete.
VarintOverflow
A varint ran past the maximum width for its type.
InvalidLength(i64)
A length prefix was negative where null is not permitted, or does not fit in memory on this platform.
InvalidUtf8
A STRING value was not valid UTF-8.
UnknownDiscriminant
An API key, error code, or other enum discriminant is unknown.
CrcMismatch
A record batch’s stored checksum does not match its contents.
AllocationLimit
Decoding this input would allocate more than its
Budget allows — a count-prefixed array
asking for far more memory than the bytes that carry it.
AllocationFailed
The allocator refused a request the budget had approved.
NoProgress
A count-driven loop’s element consumed no input. Legal counts cannot outrun the bytes that back them; continuing would spin.
TaggedFieldOrder
A tagged-field section was not strictly ascending by tag. The spec requires ascending order, and a repeated tag would let one occurrence silently overwrite another.
Trait Implementations§
Source§impl Debug for DecodeError
impl Debug for DecodeError
Source§impl Display for DecodeError
impl Display for DecodeError
impl Eq 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)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()