Skip to main content

RawServiceClient

Struct RawServiceClient 

Source
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>

Source

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).

Source

pub fn new(handle: RmwServiceClient) -> Self

Construct from a backend-allocated handle. Same audience as RawServiceServer::new.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn reply_buffer(&self) -> &[u8] ⓘ

Borrow the inline reply buffer. Valid after a successful take_response_raw call.

Source

pub fn service_name(&self) -> &str

The service this client was created on — see EmbeddedPublisher::topic_name. phase-444.

Auto Trait Implementations§

§

impl<const REQ_BUF: usize = { crate::config::DEFAULT_RX_BUF_SIZE }, const REPLY_BUF: usize = { crate::config::DEFAULT_RX_BUF_SIZE }> !Freeze for RawServiceClient<REQ_BUF, REPLY_BUF>

§

impl<const REQ_BUF: usize = { crate::config::DEFAULT_RX_BUF_SIZE }, const REPLY_BUF: usize = { crate::config::DEFAULT_RX_BUF_SIZE }> !RefUnwindSafe for RawServiceClient<REQ_BUF, REPLY_BUF>

§

impl<const REQ_BUF: usize = { crate::config::DEFAULT_RX_BUF_SIZE }, const REPLY_BUF: usize = { crate::config::DEFAULT_RX_BUF_SIZE }> !Send for RawServiceClient<REQ_BUF, REPLY_BUF>

§

impl<const REQ_BUF: usize = { crate::config::DEFAULT_RX_BUF_SIZE }, const REPLY_BUF: usize = { crate::config::DEFAULT_RX_BUF_SIZE }> !Sync for RawServiceClient<REQ_BUF, REPLY_BUF>

§

impl<const REQ_BUF: usize, const REPLY_BUF: usize> Unpin for RawServiceClient<REQ_BUF, REPLY_BUF>

§

impl<const REQ_BUF: usize, const REPLY_BUF: usize> UnsafeUnpin for RawServiceClient<REQ_BUF, REPLY_BUF>

§

impl<const REQ_BUF: usize, const REPLY_BUF: usize> UnwindSafe for RawServiceClient<REQ_BUF, REPLY_BUF>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.