Skip to content

rlp

Namespaces

Name
rlp::base
rlp::endian

Classes

Name
struct rlp::Header
class rlp::RlpDecoder
class rlp::RlpEncoder
class rlp::RlpLargeStringEncoder
class rlp::RlpChunkedListEncoder
class rlp::RlpLargeStringDecoder
class rlp::RlpChunkedListDecoder
struct rlp::is_rlp_encodable
struct rlp::is_rlp_decodable

Types

Name
enum class Leftover
enum class EncodingError
enum class DecodingError
enum class StreamingError
template <class T >
using outcome::result< T, EncodingError, outcome::policy::all_narrow >
EncodingResult
using outcome::result< void, EncodingError, outcome::policy::all_narrow > EncodingOperationResult
template <class T >
using outcome::result< T, DecodingError, outcome::policy::all_narrow >
Result
using outcome::result< void, DecodingError, outcome::policy::all_narrow > DecodingResult
template <class T >
using outcome::result< T, StreamingError, outcome::policy::all_narrow >
StreamingResult
using outcome::result< void, StreamingError, outcome::policy::all_narrow > StreamingOperationResult
using std::array< uint8_t, 20 > Address
using std::array< uint8_t, 32 > Hash256
using std::array< uint8_t, 65 > Signature
using std::array< uint8_t, 256 > Bloom
using std::basic_string< uint8_t > Bytes
using std::basic_string_view< uint8_t > ByteView

Functions

Name
const char * encoding_error_to_string(EncodingError err)
const char * decoding_error_to_string(DecodingError err)
const char * streaming_error_to_string(StreamingError err)
std::string hexToString(ByteView bv)
EncodingOperationResult addAddress(RlpEncoder & encoder, const Address & addr)
EncodingOperationResult addHash(RlpEncoder & encoder, const Hash256 & hash)
EncodingOperationResult addSignature(RlpEncoder & encoder, const Signature & sig)
EncodingOperationResult addBloom(RlpEncoder & encoder, const Bloom & bloom)
DecodingResult readAddress(RlpDecoder & decoder, Address & addr)
DecodingResult readHash(RlpDecoder & decoder, Hash256 & hash)
DecodingResult readSignature(RlpDecoder & decoder, Signature & sig)
DecodingResult readBloom(RlpDecoder & decoder, Bloom & bloom)
template <typename Func >
StreamingOperationResult
encodeLargeString(RlpEncoder & encoder, Func && generator)
template <typename Func >
StreamingOperationResult
encodeChunkedList(RlpEncoder & encoder, Func && generator, size_t chunk_size =32768)
template <typename Func >
DecodingResult
decodeLargeString(RlpDecoder & decoder, Func && callback, size_t read_chunk_size =32768)
template <typename Func >
DecodingResult
decodeChunkedList(RlpDecoder & decoder, Func && callback)
Result< Bytes > decodeChunkedListFull(RlpDecoder & decoder)

Attributes

Name
uint8_t kEmptyStringCode
uint8_t kEmptyListCode
uint8_t kMaxShortStringLen
uint8_t kMaxShortListLen
uint8_t kShortStringOffset
uint8_t kLongStringOffset
uint8_t kShortListOffset
uint8_t kLongListOffset
uint8_t kRlpSingleByteThreshold
size_t kLongPrefixByteSize
Size of the single prefix byte prepended before the big-endian length field in long strings/lists.
size_t kSingleByteStringSize
Minimum encoded size of a single-byte RLP string (prefix byte + payload byte).
bool is_unsigned_integral_v
bool is_rlp_encodable_v
bool is_rlp_decodable_v

Types Documentation

enum Leftover

Enumerator Value Description
kProhibit
kAllow

enum EncodingError

Enumerator Value Description
kPayloadTooLarge
kEmptyInput
kUnclosedList
kUnmatchedEndList

enum DecodingError

Enumerator Value Description
kOverflow
kLeadingZero
kInputTooShort
kInputTooLong
kNonCanonicalSize
kUnexpectedList
kUnexpectedString
kUnexpectedLength
kUnexpectedListElements
kInvalidVrsValue
kListLengthMismatch
kNotInList
kMalformedHeader
kAlreadyFinalized
kNotFinalized
kInvalidChunkSize
kHeaderSizeExceeded

enum StreamingError

Enumerator Value Description
kAlreadyFinalized
kNotFinalized
kInvalidChunkSize
kHeaderSizeExceeded

using EncodingResult

template <class T >
using rlp::EncodingResult = outcome::result<T, EncodingError, outcome::policy::all_narrow>;

using EncodingOperationResult

using rlp::EncodingOperationResult = outcome::result<void, EncodingError, outcome::policy::all_narrow>;

using Result

template <class T >
using rlp::Result = outcome::result<T, DecodingError, outcome::policy::all_narrow>;

using DecodingResult

using rlp::DecodingResult = outcome::result<void, DecodingError, outcome::policy::all_narrow>;

using StreamingResult

template <class T >
using rlp::StreamingResult = outcome::result<T, StreamingError, outcome::policy::all_narrow>;

using StreamingOperationResult

using rlp::StreamingOperationResult = outcome::result<void, StreamingError, outcome::policy::all_narrow>;

using Address

using rlp::Address = std::array<uint8_t, 20>;

using Hash256

using rlp::Hash256 = std::array<uint8_t, 32>;

using Signature

using rlp::Signature = std::array<uint8_t, 65>;

using Bloom

using rlp::Bloom = std::array<uint8_t, 256>;

using Bytes

using rlp::Bytes = std::basic_string<uint8_t>;

using ByteView

using rlp::ByteView = std::basic_string_view<uint8_t>;

Functions Documentation

function encoding_error_to_string

const char * encoding_error_to_string(
    EncodingError err
)

function decoding_error_to_string

const char * decoding_error_to_string(
    DecodingError err
)

function streaming_error_to_string

const char * streaming_error_to_string(
    StreamingError err
)

function hexToString

std::string hexToString(
    ByteView bv
)

function addAddress

inline EncodingOperationResult addAddress(
    RlpEncoder & encoder,
    const Address & addr
)

function addHash

inline EncodingOperationResult addHash(
    RlpEncoder & encoder,
    const Hash256 & hash
)

function addSignature

inline EncodingOperationResult addSignature(
    RlpEncoder & encoder,
    const Signature & sig
)

function addBloom

inline EncodingOperationResult addBloom(
    RlpEncoder & encoder,
    const Bloom & bloom
)

function readAddress

inline DecodingResult readAddress(
    RlpDecoder & decoder,
    Address & addr
)

function readHash

inline DecodingResult readHash(
    RlpDecoder & decoder,
    Hash256 & hash
)

function readSignature

inline DecodingResult readSignature(
    RlpDecoder & decoder,
    Signature & sig
)

function readBloom

inline DecodingResult readBloom(
    RlpDecoder & decoder,
    Bloom & bloom
)

function encodeLargeString

template <typename Func >
inline StreamingOperationResult encodeLargeString(
    RlpEncoder & encoder,
    Func && generator
)

function encodeChunkedList

template <typename Func >
inline StreamingOperationResult encodeChunkedList(
    RlpEncoder & encoder,
    Func && generator,
    size_t chunk_size =32768
)

function decodeLargeString

template <typename Func >
inline DecodingResult decodeLargeString(
    RlpDecoder & decoder,
    Func && callback,
    size_t read_chunk_size =32768
)

function decodeChunkedList

template <typename Func >
inline DecodingResult decodeChunkedList(
    RlpDecoder & decoder,
    Func && callback
)

function decodeChunkedListFull

inline Result< Bytes > decodeChunkedListFull(
    RlpDecoder & decoder
)

Attributes Documentation

variable kEmptyStringCode

uint8_t kEmptyStringCode {0x80};

variable kEmptyListCode

uint8_t kEmptyListCode {0xC0};

variable kMaxShortStringLen

uint8_t kMaxShortStringLen {55};

variable kMaxShortListLen

uint8_t kMaxShortListLen {55};

variable kShortStringOffset

uint8_t kShortStringOffset {0x80};

variable kLongStringOffset

uint8_t kLongStringOffset {0xB7};

variable kShortListOffset

uint8_t kShortListOffset {0xC0};

variable kLongListOffset

uint8_t kLongListOffset {0xF7};

variable kRlpSingleByteThreshold

uint8_t kRlpSingleByteThreshold {0x80};

variable kLongPrefixByteSize

size_t kLongPrefixByteSize {1};

Size of the single prefix byte prepended before the big-endian length field in long strings/lists.

variable kSingleByteStringSize

size_t kSingleByteStringSize {2};

Minimum encoded size of a single-byte RLP string (prefix byte + payload byte).

variable is_unsigned_integral_v

bool is_unsigned_integral_v = std::is_integral_v<T> && std::is_unsigned_v<T> && !std::is_same_v<T, bool>;

variable is_rlp_encodable_v

bool is_rlp_encodable_v = is_rlp_encodable<T>::value;

variable is_rlp_decodable_v

bool is_rlp_decodable_v = is_rlp_decodable<T>::value;

Updated on 2026-04-13 at 23:22:46 -0700