Skip to main content

rmw_node_t

Struct rmw_node_t 

Source
#[repr(C)]
pub struct rmw_node_t { pub name: *const c_char, pub namespace_: *const c_char, pub session: *mut rmw_session_t, pub _reserved: [u8; 8], pub backend_data: *mut c_void, }
Expand description

A graph node — upstream rmw_node_t, minus what an image has no use for.

Phase 376 W4. Storage is CALLER-OWNED, like every other entity here: the runtime hands create_node a zero-initialised shell and the backend writes its backend_data into it.

Why a node exists at all when an image opens ONE session. The session half of that statement holds; the node half does not, and our own code says so. Executor keeps a node table, and CffiSession::entity_view exists SOLELY to fabricate a per-call session carrying the entity’s owning-node identity — its own comment reads “one session can host N graph nodes”. The zenoh backend then re-derives a node registry from that string by linear-scanning declared tokens. So node identity already reaches the backend, through a side channel, in every image.

Done, W5/B1 (2026-08-24). create_publisher / create_subscription / create_service / create_client take const rmw_node_t * the way upstream does. That retired the entity_view fabrication — the shim now owns a node table and calls create_node once per distinct (name, namespace), which is only true because Executor::create_node deduplicates (W5/B1.a).

Still owed: zenoh’s ensure_node_liveliness still linear-scans its own per_node_liveliness table. Retiring it needs a create_node method on the Rust Rmw/Session trait plus a trampoline in RustBackendAdapter, so that a Rust backend can be TOLD about a node the way a C one is. The slot and the table it needs both exist now; only that trait hop is missing. Do not read this paragraph as done — the first draft of this comment said the registry was retired, which it was not.

Not carried from upstream: implementation_identifier and data (one image links one backend per session, so there is nothing to disambiguate).

session IS carried, and is our context. Upstream’s node reaches its context that way and every rmw_create_* relies on it; a node with no route to its session cannot be the only argument those slots get, which is what made this field the precondition for the whole change rather than a convenience. Set by the runtime BEFORE create_node, and stable for the node’s life.

Fields§

§name: *const c_char

Node name. Borrowed; outlives the node.

§namespace_: *const c_char

Node namespace. Borrowed; outlives the node.

§session: *mut rmw_session_t

The session this node lives on — upstream’s context. Set by the runtime before create_node; never NULL in a node the runtime hands to a slot. A backend reaches its own session state through node->session->backend_data.

§_reserved: [u8; 8]

Reserved; must be zero.

§backend_data: *mut c_void

Opaque backend state. NULL until create_node succeeds.

Trait Implementations§

Source§

impl Clone for rmw_node_t

Source§

fn clone(&self) -> rmw_node_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_node_t

Source§

impl Debug for rmw_node_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.