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

Binds an action's port name to the concrete node id serving it. More...

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

Public Member Functions

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 port name and node id used to bind an action.
 
absl::StatusOr< Bytes > ToMsgpack () const
 Encodes this port 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< Port > FromMsgpack (std::string_view bytes)
 Decodes MessagePack bytes into a Port.
 

Public Attributes

std::string name
 Schema-defined port name.
 
std::string id
 Id of the node backing this port.
 

Friends

bool operator== (const Port &, const Port &)=default
 
template<typename Sink >
void AbslStringify (Sink &sink, const Port &value)
 

Detailed Description

Binds an action's port name to the concrete node id serving it.

Ports appear in a a11::data::ActionMessage to tell the peer which node backs each of the action's named inputs and outputs.

Member Function Documentation

◆ ApproxBytes()

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

Estimate memory/wire weight for session and transport limits.

◆ DebugString()

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

Return a concise representation suitable for logs and diagnostics.

◆ FromMsgpack()

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

Decodes MessagePack bytes into a Port.

◆ ToMsgpack()

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

Encodes this port as MessagePack bytes.

◆ ToMsgpackInto()

absl::Status a11::data::Port::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::Port::Validate ( ) const

Validate the port name and node id used to bind an action.

Friends And Related Symbol Documentation

◆ AbslStringify

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

◆ operator==

bool operator== ( const Port &  ,
const Port &   
)
friend

Member Data Documentation

◆ id

std::string a11::data::Port::id

Id of the node backing this port.

◆ name

std::string a11::data::Port::name

Schema-defined port name.


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