#[repr(C)]pub struct rmw_message_info_t {
pub source_timestamp: rmw_time_point_value_t,
pub received_timestamp: rmw_time_point_value_t,
pub publication_sequence_number: u64,
pub reception_sequence_number: u64,
pub publisher_gid: rmw_gid_t,
pub from_intra_process: bool,
}Expand description
Per-sample metadata — upstream rmw_message_info_t, field for field.
Phase 376 W4. Two channels carry this metadata to Rust callers today. A
backend that fills take_with_info reports it here, in caller-owned
storage, and the runtime dispatches that slot whenever it is non-NULL
(issue 1495 — before that nothing called it, and a C/C++ backend such as
Cyclone delivered every sample with no metadata at all). The Rust adapter
instead writes MESSAGE_INFO_TABLE, a side table in nros-rmw-cffi keyed
on the subscription’s backend_data ADDRESS. That table is a workaround,
not a design: it claims a pool slot per subscription and never releases
it, so a reused handle address inherits the previous subscription’s
metadata.
Passing the struct by pointer on the take call — which is what upstream does — removes all of that: the caller owns the storage, it lives exactly as long as the call, and every backend can fill it.
Retiring the side table is NOT part of this change; the take_with_info
slots are the mechanism that makes retiring it possible.
Fields§
§source_timestamp: rmw_time_point_value_tPublisher’s clock at publication, ns. 0 = no source timestamp.
received_timestamp: rmw_time_point_value_tSubscriber’s clock at reception, ns. 0 = receptions are not stamped.
publication_sequence_number: u64Publisher-side sequence, or
RMW_MESSAGE_INFO_SEQUENCE_NUMBER_UNSUPPORTED. Whether this is real is
what feature_supported answers.
reception_sequence_number: u64Subscriber-side reception count, or the same sentinel.
publisher_gid: rmw_gid_tWhich publisher sent it. All-zero data = unknown.
from_intra_process: boolTrue when the sample never left the image (Zephyr’s
Z_FEATURE_LOCAL_SUBSCRIBER, DDS intra-process).
Trait Implementations§
Source§impl Clone for rmw_message_info_t
impl Clone for rmw_message_info_t
Source§fn clone(&self) -> rmw_message_info_t
fn clone(&self) -> rmw_message_info_t
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more