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

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< BytesToMsgpack () const
 Encodes this reference as MessagePack bytes.
 

Static Public Member Functions

static absl::StatusOr< NodeRefFromMsgpack (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)
 

Detailed Description

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.

Member Function Documentation

◆ ApproxBytes()

size_t a11::data::NodeRef::ApproxBytes ( ) const

Estimate memory/wire weight for bounded-buffer accounting.

◆ DebugString()

std::string a11::data::NodeRef::DebugString ( ) const

Return a concise representation suitable for logs and diagnostics.

◆ FromMsgpack()

absl::StatusOr< NodeRef > a11::data::NodeRef::FromMsgpack ( std::string_view  bytes)
static

Decodes MessagePack bytes into a NodeRef.

◆ ToMsgpack()

absl::StatusOr< Bytes > a11::data::NodeRef::ToMsgpack ( ) const

Encodes this reference as MessagePack bytes.

◆ Validate()

absl::Status a11::data::NodeRef::Validate ( ) const

Validate the referenced node id and requested slice.

Friends And Related Symbol Documentation

◆ AbslStringify

template<typename Sink >
void AbslStringify ( Sink sink,
const NodeRef value 
)
friend

◆ operator==

bool operator== ( const NodeRef ,
const NodeRef  
)
friend

Member Data Documentation

◆ id

std::string a11::data::NodeRef::id

Id of the referenced node.

◆ length

std::optional<std::uint64_t> a11::data::NodeRef::length

Optional length of the window.

◆ offset

std::uint32_t a11::data::NodeRef::offset = 0

Byte offset into the referenced node.


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