pub struct RawServiceServer<const REQ_BUF: usize = { crate::config::DEFAULT_RX_BUF_SIZE }, const RESP_BUF: usize = { crate::config::DEFAULT_RX_BUF_SIZE }> { /* private fields */ }Expand description
Typeless service-server handle. L1 counterpart of
EmbeddedServiceServer for callers that own their own scheduler
(RTIC, embassy, FreeRTOS-task-per-entity) and the C / C++ FFI
shims.
Holds the transport handle plus an inline request buffer. The
caller polls take_request_raw
and sends replies via send_response_raw
with raw CDR bytes.
Implementations§
Source§impl<const REQ_BUF: usize, const RESP_BUF: usize> RawServiceServer<REQ_BUF, RESP_BUF>
impl<const REQ_BUF: usize, const RESP_BUF: usize> RawServiceServer<REQ_BUF, RESP_BUF>
Sourcepub fn register_waker(&self, waker: &Waker)
pub fn register_waker(&self, waker: &Waker)
Phase 122.3.c.6.e — register a Waker that fires when a new
request arrives. Mirror of the existing subscriber /
service-client wake plumbing. No-op on backends that don’t
support waking — caller falls back to polling.
Sourcepub fn new(handle: RmwServiceServer) -> Self
pub fn new(handle: RmwServiceServer) -> Self
Construct a RawServiceServer from a backend-allocated
RmwServiceServer handle. Public so external crates and the
C / C++ FFI shims can wrap a handle obtained directly from
NodeHandle::session_mut.
Sourcepub fn take_request_raw(&mut self) -> Result<Option<(usize, i64)>, NodeError>
pub fn take_request_raw(&mut self) -> Result<Option<(usize, i64)>, NodeError>
Try to receive a service request (non-blocking).
Returns Ok(Some((len, sequence_number))) when a request is
available — the raw CDR bytes live in
req_buffer at &req_buffer()[..len]
until the next call. The sequence number is required by
send_response_raw.
Sourcepub fn req_buffer(&self) -> &[u8] ⓘ
pub fn req_buffer(&self) -> &[u8] ⓘ
Borrow the inline request buffer. Valid after a successful
take_request_raw call.
Sourcepub fn send_response_raw(
&mut self,
sequence_number: i64,
data: &[u8],
) -> Result<(), NodeError>
pub fn send_response_raw( &mut self, sequence_number: i64, data: &[u8], ) -> Result<(), NodeError>
Send a reply with raw CDR bytes. sequence_number must match
the value returned by the most recent
take_request_raw.
Sourcepub fn service_name(&self) -> &str
pub fn service_name(&self) -> &str
The service this server was created on — see
EmbeddedPublisher::topic_name. phase-444.
Sourcepub fn request_subscription_actual_qos(&self) -> QoSProfile
pub fn request_subscription_actual_qos(&self) -> QoSProfile
The QoS the backend GRANTED this service’s REQUEST endpoint — issue 1437.
rmw_service_request_subscription_get_actual_qos. One create builds
TWO endpoints that negotiate against different peers, so the two
directions are two answers and neither stands for the other; a
reliable reply path over a best-effort request path is a working
service that drops calls.
A policy the backend could not report reads back as its Unknown
variant, never as the request. A backend with no read-back at all
answers QoSProfile::QOS_PROFILE_UNKNOWN,
every field an absence.
Free: read once at create and retained, so this never re-enters the transport.
Sourcepub fn response_publisher_actual_qos(&self) -> QoSProfile
pub fn response_publisher_actual_qos(&self) -> QoSProfile
The QoS the backend GRANTED this service’s RESPONSE endpoint — issue
1437. See request_subscription_actual_qos.