pub struct Metadata {
pub parameters: MetadataParameters,
/* private fields */
}Expand description
Additional data that is sent as part of output messages.
Includes a timestamp and additional user-provided parameters. The payload is a self-describing Arrow IPC stream, so the message carries no separate type descriptor.
Fields§
§parameters: MetadataParametersImplementations§
Source§impl Metadata
impl Metadata
Sourcepub const CURRENT_VERSION: u16 = 2
pub const CURRENT_VERSION: u16 = 2
Current metadata wire-format version, stamped on every outgoing message.
Bumped from 0 to 1 when the ArrowTypeInfo sidecar was dropped and the
wire format became Arrow-IPC-only, and from 1 to 2 when the binary
encoding moved from bincode to postcard (varint integers and length
prefixes, so the byte layout differs even though the field order does
not). A receiver can compare
metadata_version against this to detect a peer
speaking an incompatible format and report it clearly instead of failing
with a cryptic positional-deserialization error.
Sourcepub fn new(timestamp: Timestamp) -> Self
pub fn new(timestamp: Timestamp) -> Self
Create metadata with the given timestamp and no user parameters.
Sourcepub fn startup_marker(timestamp: Timestamp) -> Self
pub fn startup_marker(timestamp: Timestamp) -> Self
Metadata for a startup route-probe marker (see STARTUP_MARKER_PARAM).
Sourcepub fn is_startup_marker(&self) -> bool
pub fn is_startup_marker(&self) -> bool
Whether this message is a startup route-probe marker rather than node
data. Markers are consumed by the receiving node’s startup barrier and
must never be decoded or surfaced to user code — see
STARTUP_MARKER_PARAM.
Sourcepub fn startup_ack(
timestamp: Timestamp,
consumer_node: &str,
input_id: &str,
) -> Self
pub fn startup_ack( timestamp: Timestamp, consumer_node: &str, input_id: &str, ) -> Self
Metadata for a startup route-probe ack: the consumer-side reply to a
startup marker, identifying which consumer input received it (see
STARTUP_ACK_PARAM).
Sourcepub fn startup_ack_identity(&self) -> Option<(&str, &str)>
pub fn startup_ack_identity(&self) -> Option<(&str, &str)>
Some((consumer_node, input_id)) iff this message is a well-formed
startup route-probe ack — see STARTUP_ACK_PARAM. Malformed acks
(missing or wrongly-typed identity parameters) return None and are
ignored by producers, which keeps the affected output on the reliable
daemon path instead of switching on bad evidence.
Sourcepub fn from_parameters(
timestamp: Timestamp,
parameters: MetadataParameters,
) -> Self
pub fn from_parameters( timestamp: Timestamp, parameters: MetadataParameters, ) -> Self
Create metadata with the given timestamp and user parameters, stamping
the current wire-format version (CURRENT_VERSION).
Sourcepub fn metadata_version(&self) -> u16
pub fn metadata_version(&self) -> u16
The wire-format version stamped on this metadata. Compare against
CURRENT_VERSION on receive to reject peers
using an incompatible format.
Sourcepub fn timestamp(&self) -> Timestamp
pub fn timestamp(&self) -> Timestamp
The hybrid-logical-clock timestamp assigned when this message was sent.
Sourcepub fn open_telemetry_context(&self) -> String
pub fn open_telemetry_context(&self) -> String
The serialized OpenTelemetry propagation context carried in the
open_telemetry_context parameter, or an empty string if absent.