Skip to main content

RawServiceServer

Struct RawServiceServer 

Source
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 try_recv_request_raw and sends replies via send_reply_raw with raw CDR bytes.

Implementations§

Source§

impl<const REQ_BUF: usize, const RESP_BUF: usize> RawServiceServer<REQ_BUF, RESP_BUF>

Source

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.

Source

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 [crate::Node::session_mut].

Source

pub fn try_recv_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_reply_raw.

Source

pub fn req_buffer(&self) -> &[u8]

Borrow the inline request buffer. Valid after a successful try_recv_request_raw call.

Source

pub fn send_reply_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 try_recv_request_raw.

Auto Trait Implementations§

§

impl<const REQ_BUF: usize, const RESP_BUF: usize> Freeze for RawServiceServer<REQ_BUF, RESP_BUF>

§

impl<const REQ_BUF: usize, const RESP_BUF: usize> RefUnwindSafe for RawServiceServer<REQ_BUF, RESP_BUF>

§

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

§

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

§

impl<const REQ_BUF: usize, const RESP_BUF: usize> Unpin for RawServiceServer<REQ_BUF, RESP_BUF>

§

impl<const REQ_BUF: usize, const RESP_BUF: usize> UnsafeUnpin for RawServiceServer<REQ_BUF, RESP_BUF>

§

impl<const REQ_BUF: usize, const RESP_BUF: usize> UnwindSafe for RawServiceServer<REQ_BUF, RESP_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.