pub struct Metadata {
pub parameters: BTreeMap<String, Parameter>,
/* 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: BTreeMap<String, Parameter>Implementations§
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) -> Metadata
pub fn new(timestamp: Timestamp) -> Metadata
Create metadata with the given timestamp and no user parameters.
Sourcepub fn startup_marker(timestamp: Timestamp) -> Metadata
pub fn startup_marker(timestamp: Timestamp) -> Metadata
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,
) -> Metadata
pub fn startup_ack( timestamp: Timestamp, consumer_node: &str, input_id: &str, ) -> Metadata
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: BTreeMap<String, Parameter>,
) -> Metadata
pub fn from_parameters( timestamp: Timestamp, parameters: BTreeMap<String, Parameter>, ) -> Metadata
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.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Metadata
impl<'de> Deserialize<'de> for Metadata
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Metadata, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Metadata, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for Metadata
impl Serialize for Metadata
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for Metadata
Auto Trait Implementations§
impl Freeze for Metadata
impl RefUnwindSafe for Metadata
impl Send for Metadata
impl Sync for Metadata
impl Unpin for Metadata
impl UnsafeUnpin for Metadata
impl UnwindSafe for Metadata
Blanket Implementations§
Source§impl<Source> AccessAs for Source
impl<Source> AccessAs for Source
impl<T> Allocation for T
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request