[][src]Trait ssz::Decode

pub trait Decode: Sized {
    fn is_ssz_fixed_len() -> bool;
fn from_ssz_bytes(bytes: &[u8]) -> Result<Self, DecodeError>; fn ssz_fixed_len() -> usize { ... } }

Provides SSZ decoding (de-serialization) via the from_ssz_bytes(&bytes) method.

See examples/ for manual implementations or the crate root for implementations using #[derive(Decode)].

Required methods

fn is_ssz_fixed_len() -> bool

Returns true if this object has a fixed-length.

I.e., there are no variable length items in this object or any of it's contained objects.

fn from_ssz_bytes(bytes: &[u8]) -> Result<Self, DecodeError>

Attempts to decode Self from bytes, returning a DecodeError on failure.

The supplied bytes must be the exact length required to decode Self, excess bytes will result in an error.

Loading content...

Provided methods

fn ssz_fixed_len() -> usize

The number of bytes this object occupies in the fixed-length portion of the SSZ bytes.

By default, this is set to BYTES_PER_LENGTH_OFFSET which is suitable for variable length objects, but not fixed-length objects. Fixed-length objects must return a value which represents their length.

Loading content...

Implementations on Foreign Types

impl Decode for u8[src]

impl Decode for u16[src]

impl Decode for u32[src]

impl Decode for u64[src]

impl Decode for usize[src]

impl<A: Decode, B: Decode> Decode for (A, B)[src]

impl<A: Decode, B: Decode, C: Decode> Decode for (A, B, C)[src]

impl<A: Decode, B: Decode, C: Decode, D: Decode> Decode for (A, B, C, D)[src]

impl<A: Decode, B: Decode, C: Decode, D: Decode, E: Decode> Decode for (A, B, C, D, E)[src]

impl<A: Decode, B: Decode, C: Decode, D: Decode, E: Decode, F: Decode> Decode for (A, B, C, D, E, F)[src]

impl<A: Decode, B: Decode, C: Decode, D: Decode, E: Decode, F: Decode, G: Decode> Decode for (A, B, C, D, E, F, G)[src]

impl<A: Decode, B: Decode, C: Decode, D: Decode, E: Decode, F: Decode, G: Decode, H: Decode> Decode for (A, B, C, D, E, F, G, H)[src]

impl<A: Decode, B: Decode, C: Decode, D: Decode, E: Decode, F: Decode, G: Decode, H: Decode, I: Decode> Decode for (A, B, C, D, E, F, G, H, I)[src]

impl<A: Decode, B: Decode, C: Decode, D: Decode, E: Decode, F: Decode, G: Decode, H: Decode, I: Decode, J: Decode> Decode for (A, B, C, D, E, F, G, H, I, J)[src]

impl<A: Decode, B: Decode, C: Decode, D: Decode, E: Decode, F: Decode, G: Decode, H: Decode, I: Decode, J: Decode, K: Decode> Decode for (A, B, C, D, E, F, G, H, I, J, K)[src]

impl<A: Decode, B: Decode, C: Decode, D: Decode, E: Decode, F: Decode, G: Decode, H: Decode, I: Decode, J: Decode, K: Decode, L: Decode> Decode for (A, B, C, D, E, F, G, H, I, J, K, L)[src]

impl Decode for bool[src]

impl Decode for NonZeroUsize[src]

impl<T: Decode> Decode for Option<T>[src]

The SSZ union type.

impl Decode for H256[src]

impl Decode for U256[src]

impl Decode for U128[src]

impl Decode for [u8; 4][src]

impl Decode for [u8; 32][src]

impl<T: Decode> Decode for Vec<T>[src]

Loading content...

Implementors

Loading content...