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

Descriptive metadata attached to a a11::data::Chunk. 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 metadata before it crosses a store or transport boundary.
 
absl::StatusOr< std::string > GetAttribute (std::string_view key) const
 Returns attribute key, or a NotFound error when absent.
 
absl::Status SetAttribute (std::string key, std::string value)
 Sets attribute key to value.
 
absl::StatusOr< BytesToMsgpack () const
 Encodes this metadata as MessagePack bytes.
 

Static Public Member Functions

static absl::StatusOr< ChunkMetadataFromMsgpack (std::string_view bytes)
 Decodes MessagePack bytes into a ChunkMetadata.
 

Public Attributes

std::string mimetype
 Media type of the chunk payload.
 
std::optional< absl::Time > timestamp {}
 Optional creation timestamp.
 
ByteMap attributes {}
 Free-form key/value attributes.
 

Friends

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

Detailed Description

Descriptive metadata attached to a a11::data::Chunk.

Carries the payload's mimetype, an optional timestamp, and a bag of free-form attributes. The mimetype may embed a serialization type tag (see a11::data::SerializationRegistry).

Member Function Documentation

◆ ApproxBytes()

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

Estimate memory/wire weight for bounded-buffer accounting.

◆ DebugString()

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

Return a concise representation suitable for logs and diagnostics.

◆ FromMsgpack()

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

Decodes MessagePack bytes into a ChunkMetadata.

◆ GetAttribute()

absl::StatusOr< std::string > a11::data::ChunkMetadata::GetAttribute ( std::string_view  key) const

Returns attribute key, or a NotFound error when absent.

◆ SetAttribute()

absl::Status a11::data::ChunkMetadata::SetAttribute ( std::string  key,
std::string  value 
)

Sets attribute key to value.

◆ ToMsgpack()

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

Encodes this metadata as MessagePack bytes.

◆ Validate()

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

Validate metadata before it crosses a store or transport boundary.

Friends And Related Symbol Documentation

◆ AbslStringify

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

◆ operator==

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

Member Data Documentation

◆ attributes

ByteMap a11::data::ChunkMetadata::attributes {}

Free-form key/value attributes.

◆ mimetype

std::string a11::data::ChunkMetadata::mimetype

Media type of the chunk payload.

◆ timestamp

std::optional<absl::Time> a11::data::ChunkMetadata::timestamp {}

Optional creation timestamp.


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