|
A11 (C++ runtime)
Native C++ implementation of the A11 action and streaming runtime
|
A unit of data: bytes plus optional descriptive metadata. More...
#include <cpp/a11/data/types.h>
Public Member Functions | |
| size_t | ApproxBytes () const |
| Estimate memory/wire weight for bounded-buffer accounting. | |
| std::string | DebugString () const |
| Return a concise representation suitable for logs and diagnostics. | |
| std::string | GetMimetype () const |
| Returns the metadata mimetype, or empty when unset. | |
| bool | IsEmpty () const |
| Whether the chunk carries neither data nor a reference. | |
| bool | IsNull () const |
| Whether the chunk represents an explicit null value. | |
| absl::Status | Validate () const |
| Validate that payload, reference, and metadata fields are consistent. | |
| absl::StatusOr< Bytes > | ToMsgpack () const |
| Encodes this chunk as MessagePack bytes. | |
Static Public Member Functions | |
| static absl::StatusOr< Chunk > | FromMsgpack (std::string_view bytes) |
Decodes MessagePack bytes into a Chunk. | |
Public Attributes | |
| std::optional< ChunkMetadata > | metadata {} |
| Optional payload metadata. | |
| std::string | ref {} |
| Node id this chunk references, if not inline. | |
| Bytes | data {} |
| Inline byte payload. | |
Friends | |
| bool | operator== (const Chunk &, const Chunk &)=default |
| template<typename Sink > | |
| void | AbslStringify (Sink &sink, const Chunk &value) |
A unit of data: bytes plus optional descriptive metadata.
A chunk holds its payload in data with an optional metadata describing it. Instead of inline data a chunk may instead carry a ref naming another node whose content it stands in for; such a reference must be resolved before the payload is used.
| size_t a11::data::Chunk::ApproxBytes | ( | ) | const |
Estimate memory/wire weight for bounded-buffer accounting.
| std::string a11::data::Chunk::DebugString | ( | ) | const |
Return a concise representation suitable for logs and diagnostics.
|
static |
Decodes MessagePack bytes into a Chunk.
| std::string a11::data::Chunk::GetMimetype | ( | ) | const |
Returns the metadata mimetype, or empty when unset.
| bool a11::data::Chunk::IsEmpty | ( | ) | const |
Whether the chunk carries neither data nor a reference.
| bool a11::data::Chunk::IsNull | ( | ) | const |
Whether the chunk represents an explicit null value.
| absl::StatusOr< Bytes > a11::data::Chunk::ToMsgpack | ( | ) | const |
Encodes this chunk as MessagePack bytes.
| absl::Status a11::data::Chunk::Validate | ( | ) | const |
Validate that payload, reference, and metadata fields are consistent.
| Bytes a11::data::Chunk::data {} |
Inline byte payload.
| std::optional<ChunkMetadata> a11::data::Chunk::metadata {} |
Optional payload metadata.
| std::string a11::data::Chunk::ref {} |
Node id this chunk references, if not inline.