pub enum DecodeError {
Show 13 variants
UnexpectedEof {
expected: usize,
actual: usize,
},
TrailingBytes {
expected: usize,
actual: usize,
},
InvalidOffset {
offset: usize,
len: usize,
fixed: usize,
},
OffsetsNotMonotonic {
prev: usize,
curr: usize,
},
BoundExceeded {
len: u64,
bound: u64,
},
LengthMismatch {
expected: usize,
actual: usize,
},
InvalidSelector(u8),
InvalidBool(u8),
MissingBitlistSentinel,
ExcessBits,
NotSorted,
ZeroNonZero,
Custom(&'static str),
}Expand description
Errors encountered while decoding an SSZ-encoded byte slice.
Variants§
UnexpectedEof
Input ended before the entire value could be read.
TrailingBytes
Input contained more bytes than the expected value occupies.
InvalidOffset
A length offset pointed outside the input slice or below the fixed region.
OffsetsNotMonotonic
Offsets must be monotonically non-decreasing.
BoundExceeded
A variable-length object exceeded its compile-time cap.
LengthMismatch
A fixed-length vector was given the wrong number of elements.
InvalidSelector(u8)
Union/Option selector outside the allowed range.
InvalidBool(u8)
Bool byte was not 0 or 1.
MissingBitlistSentinel
Bitlist sentinel 1 bit was missing.
ExcessBits
Bitvector/Bitlist contained set bits beyond the declared length.
NotSorted
Sorted-collection keys were not strictly ascending.
ZeroNonZero
NonZeroU32 decoded as zero.
Custom(&'static str)
Custom decode error from a user implementation.
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 Eq 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