pub trait RLPDecode: Sized {
// Required method
fn decode_unfinished(rlp: &[u8]) -> Result<(Self, &[u8]), RLPDecodeError>;
// Provided method
fn decode(rlp: &[u8]) -> Result<Self, RLPDecodeError> { ... }
}Expand description
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.
Required Methods§
fn decode_unfinished(rlp: &[u8]) -> Result<(Self, &[u8]), RLPDecodeError>
Provided Methods§
fn decode(rlp: &[u8]) -> Result<Self, RLPDecodeError>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".