One piece of a node's stream: an inline chunk or a node reference.
More...
#include <cpp/a11/data/types.h>
|
| size_t | ApproxBytes () const |
| | Estimate memory/wire weight for session and transport limits.
|
| |
| std::string | DebugString () const |
| | Return a concise representation suitable for logs and diagnostics.
|
| |
| absl::Status | Validate () const |
| | Validate the node id, payload, sequence, and continuation marker.
|
| |
| absl::StatusOr< Chunk *absl_nonnull > | GetChunk () |
| | Returns the held Chunk, or an error when it holds a NodeRef.
|
| |
| absl::StatusOr< const Chunk *absl_nonnull > | GetChunk () const |
| | Returns the held Chunk, or an error when it holds a NodeRef.
|
| |
| absl::StatusOr< NodeRef *absl_nonnull > | GetNodeRef () |
| | Returns the held NodeRef, or an error when it holds a Chunk.
|
| |
| absl::StatusOr< const NodeRef *absl_nonnull > | GetNodeRef () const |
| | Returns the held NodeRef, or an error when it holds a Chunk.
|
| |
| absl::StatusOr< Bytes > | ToMsgpack () const |
| | Encodes this fragment as MessagePack bytes.
|
| |
| absl::Status | ToMsgpackInto (MsgpackWriter *absl_nonnull writer) const |
| | Append this record's fields to an already-open writer.
|
| |
|
| std::string | id = {} |
| | Id of the node this fragment belongs to.
|
| |
| std::variant< Chunk, NodeRef > | data = Chunk{} |
| | Inline chunk or reference.
|
| |
| std::optional< std::uint32_t > | seq = {} |
| | Ordering sequence number.
|
| |
| bool | continued = false |
| | Whether further fragments follow this one.
|
| |
One piece of a node's stream: an inline chunk or a node reference.
Fragments are how data flows through a named node. Each targets a node by id and carries either a Chunk or a NodeRef. seq orders fragments within the node and continued marks that more fragments follow (the stream is not yet complete).
◆ ApproxBytes()
| size_t a11::data::NodeFragment::ApproxBytes |
( |
| ) |
const |
Estimate memory/wire weight for session and transport limits.
◆ DebugString()
| std::string a11::data::NodeFragment::DebugString |
( |
| ) |
const |
Return a concise representation suitable for logs and diagnostics.
◆ FromMsgpack()
| absl::StatusOr< NodeFragment > a11::data::NodeFragment::FromMsgpack |
( |
std::string_view |
bytes | ) |
|
|
static |
◆ GetChunk() [1/2]
| absl::StatusOr< Chunk *absl_nonnull > a11::data::NodeFragment::GetChunk |
( |
| ) |
|
Returns the held Chunk, or an error when it holds a NodeRef.
◆ GetChunk() [2/2]
| absl::StatusOr< const Chunk *absl_nonnull > a11::data::NodeFragment::GetChunk |
( |
| ) |
const |
Returns the held Chunk, or an error when it holds a NodeRef.
◆ GetNodeRef() [1/2]
| absl::StatusOr< NodeRef *absl_nonnull > a11::data::NodeFragment::GetNodeRef |
( |
| ) |
|
Returns the held NodeRef, or an error when it holds a Chunk.
◆ GetNodeRef() [2/2]
| absl::StatusOr< const NodeRef *absl_nonnull > a11::data::NodeFragment::GetNodeRef |
( |
| ) |
const |
Returns the held NodeRef, or an error when it holds a Chunk.
◆ ToMsgpack()
| absl::StatusOr< Bytes > a11::data::NodeFragment::ToMsgpack |
( |
| ) |
const |
Encodes this fragment as MessagePack bytes.
◆ ToMsgpackInto()
| absl::Status a11::data::NodeFragment::ToMsgpackInto |
( |
MsgpackWriter *absl_nonnull |
writer | ) |
const |
Append this record's fields to an already-open writer.
What ToMsgpack() is built from, and what a parent record calls through MsgpackWriter::PackRecord so that nesting costs no buffer of its own. Both produce the same bytes; this one avoids the intermediate string.
Assumes the record is already valid. Validate() recurses through nested records, so validating here as well would re-check every nested id once per ancestor level. ToMsgpack() validates the whole tree once and then calls this; a caller reaching for this directly should do the same, and any caller that got its record from FromMsgpack() already has.
◆ Validate()
| absl::Status a11::data::NodeFragment::Validate |
( |
| ) |
const |
Validate the node id, payload, sequence, and continuation marker.
◆ AbslStringify
template<typename Sink >
| void AbslStringify |
( |
Sink & |
sink, |
|
|
const NodeFragment & |
value |
|
) |
| |
|
friend |
◆ operator==
◆ continued
| bool a11::data::NodeFragment::continued = false |
Whether further fragments follow this one.
◆ data
Inline chunk or reference.
◆ id
| std::string a11::data::NodeFragment::id = {} |
Id of the node this fragment belongs to.
◆ seq
| std::optional<std::uint32_t> a11::data::NodeFragment::seq = {} |
Ordering sequence number.
The documentation for this struct was generated from the following files: