Skip to main content

RLPDecode

Trait RLPDecode 

Source
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§

Source

fn decode_unfinished(rlp: &[u8]) -> Result<(Self, &[u8]), RLPDecodeError>

Provided Methods§

Source

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".

Implementations on Foreign Types§

Source§

impl RLPDecode for Address

Source§

impl RLPDecode for Bloom

Source§

impl RLPDecode for Bytes

Source§

impl RLPDecode for BytesMut

Source§

impl RLPDecode for H32

Source§

impl RLPDecode for H64

Source§

impl RLPDecode for H128

Source§

impl RLPDecode for H256

Source§

impl RLPDecode for H264

Source§

impl RLPDecode for H512

Source§

impl RLPDecode for IpAddr

Source§

impl RLPDecode for Ipv4Addr

Source§

impl RLPDecode for Ipv6Addr

Source§

impl RLPDecode for Signature

Source§

impl RLPDecode for String

Source§

impl RLPDecode for U256

Source§

impl RLPDecode for bool

Source§

impl RLPDecode for u8

Source§

impl RLPDecode for u16

Source§

impl RLPDecode for u32

Source§

impl RLPDecode for u64

Source§

impl RLPDecode for u128

Source§

impl RLPDecode for usize

Source§

impl<T1: RLPDecode, T2: RLPDecode, T3: RLPDecode, T4: RLPDecode> RLPDecode for (T1, T2, T3, T4)

Source§

impl<T1: RLPDecode, T2: RLPDecode, T3: RLPDecode> RLPDecode for (T1, T2, T3)

Source§

impl<T1: RLPDecode, T2: RLPDecode> RLPDecode for (T1, T2)

Source§

impl<T: RLPDecode> RLPDecode for Vec<T>

Source§

impl<const N: usize> RLPDecode for [u8; N]

Implementors§