Skip to main content

Crate alloy_rlp_derive

Crate alloy_rlp_derive 

Source
Expand description

§alloy-rlp-derive

This crate provides derive macros for traits defined in alloy-rlp. See that crate’s documentation for more information.

This library also supports up to 1 #[rlp(default)] in a struct, which is similar to #[serde(default)] with the caveat that we use the Default value if the field deserialization fails, as we don’t serialize field names and there is no way to tell if it is present or not.

Derive Macros§

RlpDecodable
Derives Decodable for the type whose implementation expects an rlp-list input: <rlp-header, fields...>
RlpDecodableWrapper
Derives Decodable for the type whose implementation expects only the individual fields encoded: <fields...>
RlpEncodable
Derives Encodable for the type which encodes the all fields as list: <rlp-header, fields...>
RlpEncodableWrapper
Derives Encodable for the newtype which encodes its single field as-is, without a header: <field>
RlpMaxEncodedLen
Derives MaxEncodedLen for types of constant size.