Skip to main content

ServiceClientCallback

Struct ServiceClientCallback 

Source
pub struct ServiceClientCallback<Svc: RosService, const REQ_BUF: usize = { crate::config::DEFAULT_RX_BUF_SIZE }, const REPLY_BUF: usize = { crate::config::DEFAULT_RX_BUF_SIZE }> { /* private fields */ }
Expand description

Send handle for a callback-based typed service client.

Returned by create_client_with_callback: the reply is delivered to the registered closure at spin_once (no Promise poll). This handle only sends — it holds a *mut to the arena entry’s ServiceClientSendHeader (pinned in the executor arena, like a guard-condition flag), so a single outstanding request is gated by hdr.pending.

§Safety / lifetime

Valid only while the owning executor lives (the arena backs the header). Do not use after the executor is dropped.

Implementations§

Source§

impl<Svc: RosService, const REQ_BUF: usize, const REPLY_BUF: usize> ServiceClientCallback<Svc, REQ_BUF, REPLY_BUF>

Source

pub fn call(&mut self, request: &Svc::Request) -> Result<(), NodeError>

Send a typed request. The reply is delivered to the registered callback at a later spin_once. Returns RequestInFlight if a prior request has not yet been answered (single outstanding request).

Auto Trait Implementations§

§

impl<Svc, const REQ_BUF: usize, const REPLY_BUF: usize> Freeze for ServiceClientCallback<Svc, REQ_BUF, REPLY_BUF>

§

impl<Svc, const REQ_BUF: usize, const REPLY_BUF: usize> RefUnwindSafe for ServiceClientCallback<Svc, REQ_BUF, REPLY_BUF>
where Svc: RefUnwindSafe,

§

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

§

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

§

impl<Svc, const REQ_BUF: usize, const REPLY_BUF: usize> Unpin for ServiceClientCallback<Svc, REQ_BUF, REPLY_BUF>
where Svc: Unpin,

§

impl<Svc, const REQ_BUF: usize, const REPLY_BUF: usize> UnsafeUnpin for ServiceClientCallback<Svc, REQ_BUF, REPLY_BUF>

§

impl<Svc, const REQ_BUF: usize, const REPLY_BUF: usize> UnwindSafe for ServiceClientCallback<Svc, REQ_BUF, REPLY_BUF>
where Svc: UnwindSafe,

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.