Struct ros2_client::Server
source · pub struct Server<S>{ /* private fields */ }
Expand description
Server end of a ROS2 Service
Implementations§
source§impl<S> Server<S>where
S: 'static + Service,
impl<S> Server<S>where
S: 'static + Service,
sourcepub fn receive_request(&self) -> ReadResult<Option<(RmwRequestId, S::Request)>>
pub fn receive_request(&self) -> ReadResult<Option<(RmwRequestId, S::Request)>>
Receive a request from Client.
Returns Ok(None)
if no new requests have arrived.
sourcepub fn send_response(
&self,
rmw_req_id: RmwRequestId,
response: S::Response
) -> WriteResult<(), ()>
pub fn send_response( &self, rmw_req_id: RmwRequestId, response: S::Response ) -> WriteResult<(), ()>
Send response to request by Client. rmw_req_id identifies request being responded.
sourcepub async fn async_receive_request(
&self
) -> ReadResult<(RmwRequestId, S::Request)>
pub async fn async_receive_request( &self ) -> ReadResult<(RmwRequestId, S::Request)>
The request_id must be sent back with the response to identify which request and response belong together.
sourcepub fn receive_request_stream(
&self
) -> impl Stream<Item = ReadResult<(RmwRequestId, S::Request)>> + FusedStream + '_
pub fn receive_request_stream( &self ) -> impl Stream<Item = ReadResult<(RmwRequestId, S::Request)>> + FusedStream + '_
Returns a never-ending stream of (request_id, request) The request_id must be sent back with the response to identify which request and response belong together.
sourcepub async fn async_send_response(
&self,
rmw_req_id: RmwRequestId,
response: S::Response
) -> WriteResult<(), ()>
pub async fn async_send_response( &self, rmw_req_id: RmwRequestId, response: S::Response ) -> WriteResult<(), ()>
Asynchronous response sending
Trait Implementations§
Auto Trait Implementations§
impl<S> !RefUnwindSafe for Server<S>
impl<S> Send for Server<S>
impl<S> Sync for Server<S>
impl<S> Unpin for Server<S>
impl<S> !UnwindSafe for Server<S>
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