Skip to main content

rmw_subscription_options_t

Struct rmw_subscription_options_t 

Source
#[repr(C)]
pub struct rmw_subscription_options_t { pub rx_buffer_hint: u32, pub _reserved: [u8; 4], }
Expand description

Subscription creation options — the home for subscription-side transport hints (upstream: rmw_subscription_options_t). Passed as a NULLable trailing param to create_subscription; NULL = all defaults.

Fields§

§rx_buffer_hint: u32

Phase 231 (RFC-0038) — receive-buffer size hint, bytes, so a size-classing backend (zenoh-pico) can pick a small/large receive buffer. 0 = unset. A transport hint, not a DDS policy.

Phase 403 W1 — the paragraph above is what this field MEANS; the rules below are what it OBLIGES, and they are normative. They were prose in RFC-0005 (“Receive-buffer sizing: what a backend is obliged to do”) and nowhere else, so a third party reading only this header could not tell whether ignoring the hint was conformant. It is.

  • ADVISORY. A backend MAY ignore this field entirely. A backend with a single receive-buffer size is conformant, and so is one that rounds 68 up to 1024.
  • 0 IS “THIS CALLER SAID NOTHING”, NOT “THIS TYPE HAS NO BOUND”. Every message type carries a derived upper bound — bounded in the .msg (string<=64) or capped in nros-codegen.toml, and an unbounded type is a BUILD ERROR rather than something that falls back to a configured default — so the runtime always has a number to put here. 0 therefore reaches a backend only from a caller that supplied no options at all (options == NULL, or a zero-filled struct from a hand-rolled C caller). A backend must never read it as a claim that the type is unbounded, and must not treat a non-zero hint as a tighter bound than the type’s own.
  • IT IS NOT THE TAKE BUFFER. take’s buf / buf_len are owned by the RUNTIME, and buf_len is authoritative on every call — including when it disagrees with this hint, and when it changes between calls for the same subscription. A backend must not cache a length from here and write buf against it.
  • MUST NOT LIE. A backend MUST NOT copy a sample that does not fit the caller’s take buffer and return NROS_RMW_RET_OK. A sample larger than buf_len is reported as a failure — *taken = false with NROS_RMW_RET_BUFFER_TOO_SMALL — never as a truncated success. The runtime turns that into a diagnostic naming the buffer (report_dropped_take); a silent truncation is a corrupt message with no symptom at all. This is the ONE guarantee the hint carries, and it holds whether or not the backend honoured the hint.
  • NOT A WIRE BOUND. A remote publisher is bound by the .msg, never by our config, so this is no promise about incoming sample size. A backend must not size a fixed structure from it in a way that makes a larger sample undeliverable WITHOUT a diagnostic.

The vtable’s OPTIONAL required_rx_bytes is the other direction: how a backend says what it would rather the take buffer were.

§_reserved: [u8; 4]

< Reserved; must be zero.

Trait Implementations§

Source§

impl Clone for rmw_subscription_options_t

Source§

fn clone(&self) -> rmw_subscription_options_t

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for rmw_subscription_options_t

Source§

impl Debug for rmw_subscription_options_t

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.