A11 (C++ runtime)
Native C++ implementation of the A11 action and streaming runtime
Loading...
Searching...
No Matches
a11::data::MsgpackReader Class Reference

Sequentially decode the fields of one A11 MessagePack wire record. More...

#include <cpp/a11/data/msgpack.h>

Public Member Functions

 MsgpackReader (std::string_view bytes)
 Read from bytes, which must remain alive while this reader is used.
 
absl::StatusOr< nlohmann::json > Read ()
 Decode the next field and advance the byte cursor.
 
absl::Status EnsureFullyConsumed () const
 Return an error if unread trailing bytes remain in the record.
 
size_t position () const
 Current byte offset, useful when diagnosing malformed peer data.
 

Detailed Description

Sequentially decode the fields of one A11 MessagePack wire record.

Constructor & Destructor Documentation

◆ MsgpackReader()

a11::data::MsgpackReader::MsgpackReader ( std::string_view  bytes)
inlineexplicit

Read from bytes, which must remain alive while this reader is used.

Member Function Documentation

◆ EnsureFullyConsumed()

absl::Status a11::data::MsgpackReader::EnsureFullyConsumed ( ) const

Return an error if unread trailing bytes remain in the record.

◆ position()

size_t a11::data::MsgpackReader::position ( ) const
inline

Current byte offset, useful when diagnosing malformed peer data.

◆ Read()

absl::StatusOr< nlohmann::json > a11::data::MsgpackReader::Read ( )

Decode the next field and advance the byte cursor.


The documentation for this class was generated from the following files: