|
A11 (C++ runtime)
Native C++ implementation of the A11 streaming action runtime
|
A reference to a (slice of a) logical node, in lieu of inline data. 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. | |
| absl::Status | Validate () const |
| Validate the referenced node id and requested slice. | |
| absl::StatusOr< Bytes > | ToMsgpack () const |
| Encodes this reference as MessagePack bytes. | |
| absl::Status | ToMsgpackInto (MsgpackWriter *absl_nonnull writer) const |
Append this record's fields to an already-open writer. | |
Static Public Member Functions | |
| static absl::StatusOr< NodeRef > | FromMsgpack (std::string_view bytes) |
Decodes MessagePack bytes into a NodeRef. | |
Public Attributes | |
| std::string | id |
| Id of the referenced node. | |
| std::uint32_t | offset = 0 |
| Byte offset into the referenced node. | |
| std::optional< std::uint64_t > | length |
| Optional length of the window. | |
Friends | |
| bool | operator== (const NodeRef &, const NodeRef &)=default |
| template<typename Sink > | |
| void | AbslStringify (Sink &sink, const NodeRef &value) |
A reference to a (slice of a) logical node, in lieu of inline data.
Lets a fragment point at content held by another node – optionally a window of it – rather than copying the bytes.
| size_t a11::data::NodeRef::ApproxBytes | ( | ) | const |
Estimate memory/wire weight for bounded-buffer accounting.
| std::string a11::data::NodeRef::DebugString | ( | ) | const |
Return a concise representation suitable for logs and diagnostics.
|
static |
Decodes MessagePack bytes into a NodeRef.
| absl::StatusOr< Bytes > a11::data::NodeRef::ToMsgpack | ( | ) | const |
Encodes this reference as MessagePack bytes.
| absl::Status a11::data::NodeRef::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.
| absl::Status a11::data::NodeRef::Validate | ( | ) | const |
Validate the referenced node id and requested slice.
|
friend |
| std::string a11::data::NodeRef::id |
Id of the referenced node.
| std::optional<std::uint64_t> a11::data::NodeRef::length |
Optional length of the window.
| std::uint32_t a11::data::NodeRef::offset = 0 |
Byte offset into the referenced node.