Struct ssz::SszDecoderBuilder [−][src]
pub struct SszDecoderBuilder<'a> { /* fields omitted */ }
Expand description
Builds an SszDecoder
.
The purpose of this struct is to split some SSZ bytes into individual slices. The builder is
then converted into a SszDecoder
which decodes those values into object instances.
See SszDecoder
for usage examples.
Implementations
Instantiate a new builder that should build a SszDecoder
over the given bytes
which
are assumed to be the SSZ encoding of some object.
Registers a variable-length object as the next item in bytes
, without specifying the
actual type.
Notes
Use of this function is generally discouraged since it cannot detect if some type changes from variable to fixed length.
Use Self::register_type
wherever possible.
Declares that some type T
is the next item in bytes
.
pub fn register_type_parameterized(
&mut self,
is_ssz_fixed_len: bool,
ssz_fixed_len: usize
) -> Result<(), DecodeError>
pub fn register_type_parameterized(
&mut self,
is_ssz_fixed_len: bool,
ssz_fixed_len: usize
) -> Result<(), DecodeError>
Declares that a type with the given parameters is the next item in bytes
.
Finalizes the builder, returning a SszDecoder
that may be used to instantiate objects.