Skip to main content

NodeBuilder

Struct NodeBuilder 

Source
pub struct NodeBuilder<'a, 'cfg> { /* private fields */ }
Expand description

Builder returned by Executor::node_builder(name). Chainable configuration; .build() registers the Node with the Executor and returns a NodeId.

rclcpp-aligned API. Mirrors:

rclcpp::Node::make_shared("my_node",
    rclcpp::NodeOptions().use_intra_process_comms(true))

Where rclcpp uses a single NodeOptions struct, we expose the individual setters directly on the builder — fewer cycles when the user only needs one option.

Implementations§

Source§

impl<'a, 'cfg> NodeBuilder<'a, 'cfg>

Source

pub fn rmw(self, name: &'cfg str) -> Self

Select an RMW backend by name. name must match a backend registered via nros_rmw_cffi_register_named (Phase 104.B.2).

In Phase 104.C.2 (current), the name must match the backend the Executor was opened against — bridge mode lands in 104.C.3 when per-Node sessions are wired. Passing a name that doesn’t match the Executor’s session returns Err(NodeError::BackendMismatch) from .build().

Source

pub fn locator(self, locator: &'cfg str) -> Self

Override the locator for this Node’s session. Empty / unset = use the Executor’s locator.

Source

pub fn domain_id(self, domain_id: u32) -> Self

Override the domain id for this Node’s session.

Source

pub fn session_idx(self, idx: u8) -> Self

Phase 172.K.5 — bind this Node to an explicit session slot (index into the sessions opened by [Executor::open_multi]: 0 = primary, N = extra_sessions[N-1]). Bypasses the rmw-based session resolution — the caller (generated multi-domain wiring) already knows the slot.

Source

pub fn namespace(self, namespace: &'cfg str) -> Self

Namespace for handles created via this Node. Empty = “/”.

Source

pub fn sched(self, sched: SchedContextId) -> Self

Default SchedContext for handles registered via this Node. Phase 110 integration — handles inherit this unless they pass their own SchedContext at registration time.

Source

pub fn build(self) -> Result<NodeId, NodeError>

Register the Node with the Executor and return its NodeId. Bumps Executor.nodes.len(); fails if the table is full (NROS_EXECUTOR_MAX_NODES reached) or the name is too long.

Auto Trait Implementations§

§

impl<'a, 'cfg> Freeze for NodeBuilder<'a, 'cfg>

§

impl<'a, 'cfg> RefUnwindSafe for NodeBuilder<'a, 'cfg>

§

impl<'a, 'cfg> Send for NodeBuilder<'a, 'cfg>

§

impl<'a, 'cfg> !Sync for NodeBuilder<'a, 'cfg>

§

impl<'a, 'cfg> Unpin for NodeBuilder<'a, 'cfg>

§

impl<'a, 'cfg> UnsafeUnpin for NodeBuilder<'a, 'cfg>

§

impl<'a, 'cfg> !UnwindSafe for NodeBuilder<'a, 'cfg>

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.