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_unfinishedmethod is used to decode an RLP encoded slice of data and return the decoded value along with the remaining bytes. Thedecodemethod is used to decode an RLP encoded slice of data and return the decoded value. Implementors need to implement thedecode_unfinishedmethod. While consumers can use thedecodemethod 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.