pub trait Decode: Sized {
// Required methods
fn is_ssz_fixed_len() -> bool;
fn from_ssz_bytes(bytes: &[u8]) -> Result<Self, DecodeError>;
// Provided method
fn ssz_fixed_len() -> usize { ... }
}Expand description
SSZ decoding trait.
Required Methods§
Sourcefn is_ssz_fixed_len() -> bool
fn is_ssz_fixed_len() -> bool
true iff this type is fixed-length.
Sourcefn from_ssz_bytes(bytes: &[u8]) -> Result<Self, DecodeError>
fn from_ssz_bytes(bytes: &[u8]) -> Result<Self, DecodeError>
Decode a full instance from bytes, rejecting trailing input.
Provided Methods§
Sourcefn ssz_fixed_len() -> usize
fn ssz_fixed_len() -> usize
Number of bytes this type occupies in the fixed-length portion of a
container encoding. Variable-length types return
BYTES_PER_LENGTH_OFFSET.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.