Skip to content

RlpEncodeErrors

Set of errors while performing rlp encoding.

error{ NegativeNumber, Overflow } || Allocator.Error

EncodeRlp

RLP Encoding according to the spec.

Reflects on the items and encodes based on it's type.
Supports almost all of zig's type.

Doesn't support opaque, fn, anyframe, error_union, void, null types.

Example
const encoded = try encodeRlp(allocator, 69420);
defer allocator.free(encoded);

Signature

pub fn encodeRlp(allocator: Allocator, payload: anytype) RlpEncodeErrors![]u8