Function ssz::split_union_bytes
source · pub fn split_union_bytes(
bytes: &[u8],
) -> Result<(UnionSelector, &[u8]), DecodeError>
Expand description
Takes bytes
, assuming it is the encoding for a SSZ union, and returns the union-selector and
the body (trailing bytes).
§Errors
Returns an error if:
bytes
is empty.- the union selector is not a valid value (i.e., larger than the maximum number of variants.