Skip to main content

Module decode

Module decode 

Source

Traits§

RLPDecode
Trait for decoding RLP encoded slices of data. See https://ethereum.org/en/developers/docs/data-structures-and-encoding/rlp/#rlp-decoding for more information. The decode_unfinished method is used to decode an RLP encoded slice of data and return the decoded value along with the remaining bytes. The decode method is used to decode an RLP encoded slice of data and return the decoded value. Implementors need to implement the decode_unfinished method. While consumers can use the decode method to decode the RLP encoded data.

Functions§

decode_bytes
Decodes the payload of an RLP item from a slice of bytes. It returns a 2-element tuple with the following elements:
decode_rlp_item
Decodes an RLP item from a slice of bytes. It returns a 3-element tuple with the following elements:
get_item_with_prefix
Splits an RLP item in two:
get_rlp_bytes_item_payload
Receives an RLP bytes item (prefix between 0xb8 and 0xbf) and returns its payload
is_encoded_as_bytes
static_left_pad
Pads a slice of bytes with zeros on the left to make it a fixed size slice. The size of the data must be less than or equal to the size of the output array.