Skip to main content

Module service_info

Module service_info 

Source
Expand description

Per-request metadata handed to a service callback — rclrs’s ServiceInfo.

Issue 1942. rclrs 0.7 can pass a service callback a ServiceInfo beside the request: who sent it (the client’s GID and its sequence number, together the upstream rmw_request_id_t) and when (source and received timestamps). This is the counterpart, registered through Node::create_service_with_info or node.service(name).service_info().

Not to be confused with nros_rmw::ServiceInfo, the RMW seam’s service DESCRIPTOR (name, type, hash, domain). That type is not re-exported by the nros facade (RFC-0071 D12, phase-506 W1), which is what lets this one take rclrs’s name there.

§What a backend reports

Every field is an Option, because whether a request carries it is a BACKEND property, and a backend that cannot say leaves the field None rather than inventing a value — the MessageInfo precedent, where a backend that reports no metadata hands the callback None instead of a zeroed struct. rclrs’s fields are not optional; ours are, and that is the one shape divergence.

backendrequest_idsource_timestampreceived_timestamp
zenohfrom the query attachment (rmw_zenoh_cpp layout)from the attachmentthe queryable callback’s wall-clock stamp
Cyclone DDSrequest header guid + publication handle, header seq (stock rmw_cyclonedds_cpp’s layout)the DDS sample’s source timestampNone (Cyclone 0.10 has none)
XRCE-DDSthe Agent’s SampleIdentity (client writer GUID + sequence)Nonethe request callback’s wall-clock stamp
a C-ABI backend without take_request_with_infoNoneNoneNone

received_timestamp is upstream’s: the server’s wall clock (ns since the Unix epoch) when the request arrived (issue 2135); None on a platform with no wall clock.

A C-ABI backend reports through the vtable’s take_request_with_info slot (issue 2081), whose rmw_service_info_t spells “not reported” as zero; the runtime turns each zero into None.

Structs§

RequestId
Identity of one service request — rclrs’s RequestId, upstream’s rmw_request_id_t.
ServiceInfo
Metadata about one received service request — rclrs’s ServiceInfo.

Constants§

REQUEST_WRITER_GUID_SIZE
Width of RequestId::writer_guid, in bytes.