RlpDecodeErrors
Set of errors while performing RLP decoding.
error{ UnexpectedValue, InvalidEnumTag, LengthMissmatch, Overflow } || Allocator.ErrorDecodeRlp
RLP decoding wrapper function. Encoded string must follow the RLP specification.
Supported types:
- bool
- int
- enum,- enum_literal
- null
- ?T
- [N]Tarray types.
- []const Tslices.
- structs. Both tuple and non tuples.
All other types are currently not supported.
Signature
pub fn decodeRlp(comptime T: type, allocator: Allocator, encoded: []const u8) RlpDecodeErrors!TRlpDecoder
RLP Decoder structure. Decodes based on the RLP specification.
Properties
struct {
  /// The RLP encoded slice.
  encoded: []const u8
  /// The position into the encoded slice.
  position: usize
}Init
Sets the decoder initial state.
Signature
pub fn init(encoded: []const u8) RlpDecoderAdvancePosition
Advances the decoder position by new size.
Signature
pub fn advancePosition(self: *RlpDecoder, new: usize) voidDecode
Decodes a rlp encoded slice into a provided type. The encoded slice must follow the RLP specification.
Supported types:
- bool
- int
- enum,- enum_literal
- null
- ?T
- [N]Tarray types.
- []const Tslices.
- structs. Both tuple and non tuples.
All other types are currently not supported.
Signature
pub fn decode(self: *RlpDecoder, comptime T: type, allocator: Allocator) RlpDecodeErrors!T