pub struct CffiService { /* private fields */ }Expand description
Service server backed by a C vtable.
Implementations§
Source§impl CffiService
impl CffiService
Trait Implementations§
Source§impl Drop for CffiService
impl Drop for CffiService
Source§impl ServiceTrait for CffiService
impl ServiceTrait for CffiService
Source§fn request_subscription_actual_qos(&self) -> QoSProfile
fn request_subscription_actual_qos(&self) -> QoSProfile
What the REQUEST endpoint — the subscription this service takes requests on — was granted.
Source§fn response_publisher_actual_qos(&self) -> QoSProfile
fn response_publisher_actual_qos(&self) -> QoSProfile
What the RESPONSE endpoint — the publisher this service answers on — was granted. Not necessarily the same profile: one request built both endpoints, and they negotiate against different peers.
Source§type Error = TransportError
type Error = TransportError
Error type for service operations
Source§fn register_waker(&self, waker: &Waker) -> bool
fn register_waker(&self, waker: &Waker) -> bool
Phase 122.3.c.6.e — register a
Waker for event-driven
service servers. Mirrors the matching method on
SubscriberTrait / ClientTrait. Backends that
surface incoming-request notifications wake waker when
has_request() flips true. Returns false when the backend cannot
(issue 1940); the caller then falls back to polling. Default: false.Source§fn has_request(&self) -> bool
fn has_request(&self) -> bool
Check if a request is available without consuming it. Read more
Source§fn take_request<'a>(
&mut self,
buf: &'a mut [u8],
) -> Result<Option<ServiceRequest<'a>>, TransportError>
fn take_request<'a>( &mut self, buf: &'a mut [u8], ) -> Result<Option<ServiceRequest<'a>>, TransportError>
Try to receive a service request into
buf (non-blocking). Read moreSource§fn refused_request_len(&self) -> Option<usize>
fn refused_request_len(&self) -> Option<usize>
Issue 1632 — how many bytes the request the most recent
take_request REFUSED as too big for the
caller’s buffer needed. Read moreSource§fn request_info(&self) -> ServiceRequestInfo
fn request_info(&self) -> ServiceRequestInfo
Issue 1942 — the per-request metadata of the request the most recent
successful
take_request returned: client GID +
client sequence number, and the timestamps the backend can supply. Read moreSource§fn send_response(
&mut self,
sequence_number: i64,
data: &[u8],
) -> Result<(), TransportError>
fn send_response( &mut self, sequence_number: i64, data: &[u8], ) -> Result<(), TransportError>
Send a reply for the given sequence number. Non-blocking
from the application’s perspective; the backend may queue
the reply for transport-level transmission.
Source§fn handle_request<S>(
&mut self,
req_buf: &mut [u8],
reply_buf: &mut [u8],
handler: impl FnOnce(&<S as RosService>::Request) -> <S as RosService>::Reply,
) -> Result<bool, Self::Error>
fn handle_request<S>( &mut self, req_buf: &mut [u8], reply_buf: &mut [u8], handler: impl FnOnce(&<S as RosService>::Request) -> <S as RosService>::Reply, ) -> Result<bool, Self::Error>
Handle a service request with typed messages
Source§fn handle_request_with_info<S>(
&mut self,
req_buf: &mut [u8],
reply_buf: &mut [u8],
handler: impl FnOnce(&<S as RosService>::Request, &ServiceInfo) -> <S as RosService>::Reply,
) -> Result<bool, Self::Error>
fn handle_request_with_info<S>( &mut self, req_buf: &mut [u8], reply_buf: &mut [u8], handler: impl FnOnce(&<S as RosService>::Request, &ServiceInfo) -> <S as RosService>::Reply, ) -> Result<bool, Self::Error>
Issue 1942 —
handle_request, with the
request’s ServiceInfo (read through
request_info right after the take) handed to
the handler beside it. rclrs’s (request, ServiceInfo) callback.Source§fn handle_request_boxed<S>(
&mut self,
req_buf: &mut [u8],
reply_buf: &mut [u8],
handler: impl FnOnce(&<S as RosService>::Request) -> Box<<S as RosService>::Reply>,
) -> Result<bool, Self::Error>
fn handle_request_boxed<S>( &mut self, req_buf: &mut [u8], reply_buf: &mut [u8], handler: impl FnOnce(&<S as RosService>::Request) -> Box<<S as RosService>::Reply>, ) -> Result<bool, Self::Error>
Handle a service request where the handler returns
Box<S::Reply> Read moreSource§fn handle_request_raw(
&mut self,
req_buf: &mut [u8],
reply_buf: &mut [u8],
handler: impl FnOnce(&mut CdrReader<'_>, &mut CdrWriter<'_>) -> Result<(), TransportError>,
) -> Result<bool, Self::Error>
fn handle_request_raw( &mut self, req_buf: &mut [u8], reply_buf: &mut [u8], handler: impl FnOnce(&mut CdrReader<'_>, &mut CdrWriter<'_>) -> Result<(), TransportError>, ) -> Result<bool, Self::Error>
Handle one request by STREAMING: the handler reads fields off the wire
and writes the reply’s fields straight back, so neither the request nor
the reply is ever materialised as a value. Read more
Auto Trait Implementations§
impl !Freeze for CffiService
impl !RefUnwindSafe for CffiService
impl !Send for CffiService
impl !Sync for CffiService
impl Unpin for CffiService
impl UnsafeUnpin for CffiService
impl UnwindSafe for CffiService
Blanket Implementations§
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
Mutably borrows from an owned value. Read more