[−][src]Trait ssz::Decode
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.
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.
Implementations on Foreign Types
impl Decode for u8
[src]
fn is_ssz_fixed_len() -> bool
[src]
fn ssz_fixed_len() -> usize
[src]
fn from_ssz_bytes(bytes: &[u8]) -> Result<Self, DecodeError>
[src]
impl Decode for u16
[src]
fn is_ssz_fixed_len() -> bool
[src]
fn ssz_fixed_len() -> usize
[src]
fn from_ssz_bytes(bytes: &[u8]) -> Result<Self, DecodeError>
[src]
impl Decode for u32
[src]
fn is_ssz_fixed_len() -> bool
[src]
fn ssz_fixed_len() -> usize
[src]
fn from_ssz_bytes(bytes: &[u8]) -> Result<Self, DecodeError>
[src]
impl Decode for u64
[src]
fn is_ssz_fixed_len() -> bool
[src]
fn ssz_fixed_len() -> usize
[src]
fn from_ssz_bytes(bytes: &[u8]) -> Result<Self, DecodeError>
[src]
impl Decode for usize
[src]
fn is_ssz_fixed_len() -> bool
[src]
fn ssz_fixed_len() -> usize
[src]
fn from_ssz_bytes(bytes: &[u8]) -> Result<Self, DecodeError>
[src]
impl<A: Decode, B: Decode> Decode for (A, B)
[src]
fn is_ssz_fixed_len() -> bool
[src]
fn ssz_fixed_len() -> usize
[src]
fn from_ssz_bytes(bytes: &[u8]) -> Result<Self, DecodeError>
[src]
impl<A: Decode, B: Decode, C: Decode> Decode for (A, B, C)
[src]
fn is_ssz_fixed_len() -> bool
[src]
fn ssz_fixed_len() -> usize
[src]
fn from_ssz_bytes(bytes: &[u8]) -> Result<Self, DecodeError>
[src]
impl<A: Decode, B: Decode, C: Decode, D: Decode> Decode for (A, B, C, D)
[src]
fn is_ssz_fixed_len() -> bool
[src]
fn ssz_fixed_len() -> usize
[src]
fn from_ssz_bytes(bytes: &[u8]) -> Result<Self, DecodeError>
[src]
impl<A: Decode, B: Decode, C: Decode, D: Decode, E: Decode> Decode for (A, B, C, D, E)
[src]
fn is_ssz_fixed_len() -> bool
[src]
fn ssz_fixed_len() -> usize
[src]
fn from_ssz_bytes(bytes: &[u8]) -> Result<Self, DecodeError>
[src]
impl<A: Decode, B: Decode, C: Decode, D: Decode, E: Decode, F: Decode> Decode for (A, B, C, D, E, F)
[src]
fn is_ssz_fixed_len() -> bool
[src]
fn ssz_fixed_len() -> usize
[src]
fn from_ssz_bytes(bytes: &[u8]) -> Result<Self, DecodeError>
[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]
fn is_ssz_fixed_len() -> bool
[src]
fn ssz_fixed_len() -> usize
[src]
fn from_ssz_bytes(bytes: &[u8]) -> Result<Self, DecodeError>
[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]
fn is_ssz_fixed_len() -> bool
[src]
fn ssz_fixed_len() -> usize
[src]
fn from_ssz_bytes(bytes: &[u8]) -> Result<Self, DecodeError>
[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]
fn is_ssz_fixed_len() -> bool
[src]
fn ssz_fixed_len() -> usize
[src]
fn from_ssz_bytes(bytes: &[u8]) -> Result<Self, DecodeError>
[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]
fn is_ssz_fixed_len() -> bool
[src]
fn ssz_fixed_len() -> usize
[src]
fn from_ssz_bytes(bytes: &[u8]) -> Result<Self, DecodeError>
[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]
fn is_ssz_fixed_len() -> bool
[src]
fn ssz_fixed_len() -> usize
[src]
fn from_ssz_bytes(bytes: &[u8]) -> Result<Self, DecodeError>
[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]
fn is_ssz_fixed_len() -> bool
[src]
fn ssz_fixed_len() -> usize
[src]
fn from_ssz_bytes(bytes: &[u8]) -> Result<Self, DecodeError>
[src]
impl Decode for bool
[src]
fn is_ssz_fixed_len() -> bool
[src]
fn ssz_fixed_len() -> usize
[src]
fn from_ssz_bytes(bytes: &[u8]) -> Result<Self, DecodeError>
[src]
impl Decode for NonZeroUsize
[src]
fn is_ssz_fixed_len() -> bool
[src]
fn ssz_fixed_len() -> usize
[src]
fn from_ssz_bytes(bytes: &[u8]) -> Result<Self, DecodeError>
[src]
impl<T: Decode> Decode for Option<T>
[src]
The SSZ union type.