pub struct RawServiceClient<const REQ_BUF: usize = { crate::config::DEFAULT_RX_BUF_SIZE }, const REPLY_BUF: usize = { crate::config::DEFAULT_RX_BUF_SIZE }> { /* private fields */ }Expand description
Typeless service-client handle. L1 counterpart of
EmbeddedServiceClient for the same audience as
RawServiceServer.
Implementations§
Source§impl<const REQ_BUF: usize, const REPLY_BUF: usize> RawServiceClient<REQ_BUF, REPLY_BUF>
impl<const REQ_BUF: usize, const REPLY_BUF: usize> RawServiceClient<REQ_BUF, REPLY_BUF>
Sourcepub fn register_waker(&self, waker: &Waker) -> bool
pub fn register_waker(&self, waker: &Waker) -> bool
Phase 122.3.c.6.e — register a Waker that fires when the
reply to a previously-sent request lands. Returns false on a
backend that cannot wake (issue 1940).
Sourcepub fn new(handle: RmwServiceClient) -> Self
pub fn new(handle: RmwServiceClient) -> Self
Construct from a backend-allocated handle. Same audience as
RawServiceServer::new.
Sourcepub fn request_publisher_actual_qos(&self) -> QoSProfile
pub fn request_publisher_actual_qos(&self) -> QoSProfile
The QoS the backend GRANTED this client’s REQUEST endpoint — issue
1437. The client-side mirror of
RawServiceServer::request_subscription_actual_qos: same topic pair,
the other end of it, and the two need not agree.
Sourcepub fn response_subscription_actual_qos(&self) -> QoSProfile
pub fn response_subscription_actual_qos(&self) -> QoSProfile
The QoS the backend GRANTED this client’s RESPONSE endpoint — issue
1437. See request_publisher_actual_qos.
Sourcepub fn send_request_raw(&mut self, request: &[u8]) -> Result<i64, NodeError>
pub fn send_request_raw(&mut self, request: &[u8]) -> Result<i64, NodeError>
Send a raw CDR request. Non-blocking; the reply arrives via
take_response_raw.
Returns the SEQUENCE ID the backend assigned (issue 2009), which the
reply carries back. This handle keeps no table: a caller with more than
one request outstanding matches the id itself — the shape of upstream’s
rcl_send_request(client, req, &sequence_number). It is
nros_rmw::SEQUENCE_ID_UNKNOWN on a backend that cannot assign ids.
Sourcepub fn service_is_ready(&self) -> Result<bool, NodeError>
pub fn service_is_ready(&self) -> Result<bool, NodeError>
Phase 124.G.3 — graph-aware “is the matching server up?”
probe. Mirrors EmbeddedServiceClient::service_is_ready for the raw API.
Sourcepub fn take_response_raw(&mut self) -> Result<Option<(usize, i64)>, NodeError>
pub fn take_response_raw(&mut self) -> Result<Option<(usize, i64)>, NodeError>
Try to receive a reply (non-blocking). Returns
Ok(Some((len, sequence_id))) on success; bytes live in
reply_buffer until the next call, and
sequence_id is the one send_request_raw
returned for the request this answers (issue 2009) — upstream’s
rcl_take_response request header.
Sourcepub fn reply_buffer(&self) -> &[u8] ⓘ
pub fn reply_buffer(&self) -> &[u8] ⓘ
Borrow the inline reply buffer. Valid after a successful
take_response_raw call.
Sourcepub fn service_name(&self) -> &str
pub fn service_name(&self) -> &str
The service this client was created on — see
EmbeddedPublisher::topic_name. phase-444.