[][src]Enum ssz::DecodeError

pub enum DecodeError {
    InvalidByteLength {
        len: usize,
        expected: usize,
    },
    InvalidLengthPrefix {
        len: usize,
        expected: usize,
    },
    OutOfBoundsByte {
        i: usize,
    },
    BytesInvalid(String),
}

Returned when SSZ decoding fails.

Variants

InvalidByteLength

The bytes supplied were too short to be decoded into the specified type.

Fields of InvalidByteLength

len: usizeexpected: usize
InvalidLengthPrefix

The given bytes were too short to be read as a length prefix.

Fields of InvalidLengthPrefix

len: usizeexpected: usize
OutOfBoundsByte

A length offset pointed to a byte that was out-of-bounds (OOB).

A bytes may be OOB for the following reasons:

  • It is >= bytes.len().
  • When decoding variable length items, the 1st offset points "backwards" into the fixed length items (i.e., length[0] < BYTES_PER_LENGTH_OFFSET).
  • When decoding variable-length items, the n'th offset was less than the n-1'th offset.

Fields of OutOfBoundsByte

i: usize
BytesInvalid(String)

The given bytes were invalid for some application-level reason.

Trait Implementations

impl PartialEq<DecodeError> for DecodeError[src]

impl Debug for DecodeError[src]

Auto Trait Implementations

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]