Skip to main content

Node

Struct Node 

Source
pub struct Node<'e, 's> { /* private fields */ }
Expand description

A ROS 2 node — rclrs’s Node, and the ONE node type (phase-483 W2).

Executor::create_node(name) returns it, and so does Executor::node_mut(id); a component and a standalone program hold the same type. It carries rclrs’s methods — create_publisher, create_subscription(topic, callback), create_service, timers, the clock, name / namespace / logger, the graph queries — plus RTOS extensions with names of their own (create_polling_*, the _sized and _raw constructors).

ADOPT-BOUNDED: a node is a short-lived &mut Executor borrow, not rclrs’s Arc<Node>. Create entities, then drop it before acquiring the next node handle; entity handles (HandleId, publishers) are owned and outlive it (no allocator — see docs/design/0022-entity-api-tiers.md §Borrow model).

Implementations§

Source§

impl<'e, 's> Node<'e, 's>

Source

pub fn name(&self) -> &str

The node’s name — rclrs’s Node::name().

phase-483 W2. Read from the executor’s node table, where the name the node was created with (or the launch file’s override of it) lives.

Source

pub fn namespace(&self) -> &str

The node’s namespace — rclrs’s Node::namespace(). "" is the root.

Source

pub fn fully_qualified_name( &self, ) -> Result<String<nros_node::::names::ResolvedName::{constant#0}>, NodeError>

/<namespace>/<name> — rclrs’s Node::fully_qualified_name().

Bounded, where rclrs returns a String: no allocator here, and the two halves are each at most 64 bytes.

Source

pub fn domain_id(&self) -> u32

The node’s ROS domain — rclrs’s Node::domain_id(). Every node of an executor shares its session, so this is the executor’s domain.

Source

pub fn logger(&self) -> &'static Logger

The logger named for this node — rclrs’s Node::logger(). See NodeHandle::logger for how the name is resolved.

Source

pub fn id(&self) -> NodeId

This node’s id in the executor’s node table — an RTOS extension, for the APIs that address a node by id (Executor::node_mut, the per-node QoS override table).

Source

pub fn get_clock(&self) -> Clock

The node’s clock — rclrs’s Node::get_clock(), and rclcpp’s.

phase-417 G6. cpp:Node::get_clock has shipped since issue 0789 and only the Rust node lacked the accessor: a component reached the clock through the executor, or constructed one, and the ported line node.get_clock().now() had nothing to bind.

A delegation, not a second clock. nros_core::clock::Clock is a one-field value naming a time SOURCE — it holds no state of its own, and now() on a ROS-time clock reads the process-global override that install_ros_time_source installs. So this returns the same answer as the executor’s clock by construction rather than by agreement, which is the property the graph forwarders in this family are shaped for.

ROS TIME, as rclcpp’s and rclrs’s node clocks are: with a /clock source installed it follows the simulator, and with none it reads the same wall clock Clock::system() does (issue 1334 put those two on one expression). A component that specifically wants the monotonic source asks for Clock::steady().

By VALUE, where rclcpp hands back a Clock::SharedPtr: there is no allocator here (RFC-0022) and the type is Copy, so a handle would be a pointer to one u8.

Source

pub fn subscription<'t>( &mut self, topic: &'t str, ) -> SubscriptionBuilder<'_, 'e, 't, 's>

Subscription builder (the clone tier). Pick a mode with .typed::<M>() or .generic(type, hash), set knobs (.qos), then .build(callback).

Source

pub fn publisher<'t>( &mut self, topic: &'t str, ) -> CtxPublisherBuilder<'_, 'e, 't, 's>

Publisher builder (the clone tier), symmetric with subscription. Pick .typed::<M>() or .generic(type, hash), set .qos(), then .build(). The returned publisher handle is owned and outlives this Node — the bridge builds the dest publisher on one ctx, drops it, then registers the source subscription on another (see 0022-entity-api-tiers.md).

Source

pub fn create_publisher<M>( &mut self, topic: &str, ) -> Result<EmbeddedPublisher<M>, NodeError>
where M: MessageForRmw,

Convenient typed publisher (the fork tier — rclcpp/rclrs shape).

Source

pub fn create_generic_publisher( &mut self, topic: &str, type_name: &str, type_hash: &str, ) -> Result<EmbeddedRawPublisher, NodeError>

Convenient generic (type-erased) publisher — rclcpp create_generic_*.

Source

pub fn create_generic_publisher_with_qos( &mut self, topic: &str, type_name: &str, type_hash: &str, qos: QoSProfile, ) -> Result<EmbeddedRawPublisher, NodeError>

Issue 0306 — the same, with an explicit profile. The declarative component path needs it: a node that declares create_publisher_for_topic_with_qos(...) carries its profile in EntityMetadata::qos, and the runtime used to drop it on the floor by calling the default-QoS constructor here.

Source

pub fn create_subscription<M, F>( &mut self, topic: &str, callback: F, ) -> Result<HandleId, NodeError>
where M: MessageForRmw + 'static, F: FnMut(&M) + 'static,

Convenient typed subscription (the fork tier — rclcpp/rclrs shape). Sugar over the builder with default QoS + buffer.

Source

pub fn create_callback_group(&self, name: &str) -> CallbackGroup

Create a named callback group — a thin token wrapping the group name.

Pass the returned CallbackGroup to the _in create variants (create_timer_in_group, create_subscription_in_group, create_publisher_in_group) to label entities with this group. The executor binds the entity’s callback to the SchedContext seeded via bind_group_sched for (node_name, namespace, group_name) (phase 273 W1/W2).

ⓘ
let ctrl = node.create_callback_group("ctrl");
node.create_timer_in_group(&ctrl, TimerDuration::from_millis(10), || { /* … */ })?;

Names longer than 32 bytes are silently truncated.

Source

pub fn create_timer_in_group<F>( &mut self, group: &CallbackGroup, period: TimerDuration, callback: F, ) -> Result<HandleId, NodeError>
where F: FnMut() + 'static,

Create a repeating timer in a callback group (phase 273, rclcpp shape).

The timer’s callback is bound to the SchedContext associated with group in the executor’s group_sched_table for this node. If no entry was seeded for the group, the node’s default SchedContext applies (same as register_timer). period fires the callback repeatedly.

Source

pub fn create_guard_condition<F>( &mut self, callback: F, ) -> Result<(HandleId, GuardCondition), NodeError>
where F: FnMut() + 'static,

Create a guard condition on this node — phase-417 W4.e, the Rust half of the one creation shape.

A guard condition is the cross-thread / ISR wake source: any thread may call GuardCondition::trigger and the callback runs on the executor’s next spin_once. The flag itself lives in the executor’s arena, which is what makes the returned handle Send + Sync with no allocation — so the NODE is the owner a caller names and the EXECUTOR is where the entity lands, exactly as for a timer or a subscription.

Until 2026-09-18 the only Rust spelling was Executor::register_guard_condition, while C++ created one on the node and C needed three calls. That was the three-owner state RFC-0089 stage 4 exists to remove; the executor form survives as the ours-only primitive this calls.

The returned HandleId is the slot, for trigger_one / bind_handle_to_sched_context; the GuardCondition is the trigger handle to hand to the other thread.

ⓘ
let (_id, guard) = node.create_guard_condition(|| { /* woken */ })?;
// from an ISR or another task:
guard.trigger();
Source

pub fn create_timer_on_clock<F>( &mut self, period: TimerDuration, source: TimerClockSource, callback: F, ) -> Result<HandleId, NodeError>
where F: FnMut() + 'static,

Create a repeating timer on a chosen CLOCK — phase-430 W4, the node-level spelling of Executor::register_timer_on_clock and the Rust counterpart of C++’s create_timer(clock, period, cb).

create_timer_in_group and the executor’s register_timer are the WALL case: they consume the spin delta the executor already measured, and no simulator can slow them down. A TimerClockSource::Ros timer instead follows /clock, so it stops while the simulator is paused and tracks a bag’s replay rate; with no /clock source installed it reads system time, the same fallback rclcpp::Clock has.

The timer is bound to this node, so the node’s default SchedContext applies — create_timer_on_clock_in_group is the callback-group form.

ⓘ
node.create_timer_on_clock(
    TimerDuration::from_millis(100),
    TimerClockSource::Ros,
    || { /* fires once per 100 ms of SIMULATED time */ },
)?;
Source

pub fn create_timer_on_clock_in_group<F>( &mut self, group: &CallbackGroup, period: TimerDuration, source: TimerClockSource, callback: F, ) -> Result<HandleId, NodeError>
where F: FnMut() + 'static,

create_timer_on_clock in a callback group — the clock axis on create_timer_in_group (phase-430 W4). The two axes are independent: the group decides which SchedContext the callback runs under, the clock decides what advances the timer towards its next activation.

Source

pub fn create_subscription_in_group<M, F>( &mut self, group: &CallbackGroup, topic: &str, callback: F, ) -> Result<HandleId, NodeError>
where M: MessageForRmw + 'static, F: FnMut(&M) + 'static,

Create a typed subscription in a callback group (phase 273, rclcpp shape).

The subscription’s callback is bound to the SchedContext associated with group in the group_sched_table for this node. If no entry was seeded, the node default applies.

Source

pub fn create_publisher_in_group<M>( &mut self, _group: &CallbackGroup, topic: &str, ) -> Result<EmbeddedPublisher<M>, NodeError>
where M: MessageForRmw,

Create a typed publisher in a callback group (phase 273, rclcpp shape).

Publishers do not have an executor-dispatched callback, so the group name has no scheduling effect today (publishers are explicitly driven by the user via publish()). The API is provided for symmetry and forward-compatibility (intra-process / loaned-message knobs may use it in the future).

Source

pub fn create_client_with_callback<Svc, F>( &mut self, service_name: &str, callback: F, ) -> Result<ServiceClientCallback<Svc>, NodeError>
where Svc: RosService + 'static, <Svc as RosService>::Request: MessageForRmw, <Svc as RosService>::Reply: MessageForRmw, F: FnMut(&<Svc as RosService>::Reply) + 'static,

RFC-0041 / Phase 239.1 — callback-based service client (rclcpp async_send_request(req, cb) analogue). The reply is delivered to callback at spin_once (no Promise poll). Returns a ServiceClientCallback send handle; dual-mode — the Promise-based create_client is unchanged.

Source

pub fn create_client_with_callback_sized<Svc, F, const REQ_BUF: usize, const REPLY_BUF: usize>( &mut self, service_name: &str, callback: F, ) -> Result<ServiceClientCallback<Svc, REQ_BUF, REPLY_BUF>, NodeError>
where Svc: RosService + 'static, <Svc as RosService>::Request: MessageForRmw, <Svc as RosService>::Reply: MessageForRmw, F: FnMut(&<Svc as RosService>::Reply) + 'static,

Callback-based service client with custom buffer sizes (Phase 239.1).

Source

pub fn create_action_client_with_callbacks<A, GRespF, FbF, ResF>( &mut self, action_name: &str, on_goal_response: GRespF, on_feedback: FbF, on_result: ResF, ) -> Result<ActionClientCallback<A>, NodeError>
where A: RosAction + 'static, <A as RosAction>::Goal: MessageForRmw, <A as RosAction>::Result: MessageForRmw, <A as RosAction>::Feedback: MessageForRmw, GRespF: FnMut(&GoalId, bool) + 'static, FbF: FnMut(&GoalId, &<A as RosAction>::Feedback) + 'static, ResF: FnMut(&GoalId, GoalStatus, &<A as RosAction>::Result) + 'static,

RFC-0041 / Phase 239.2 — callback-based action client (rclcpp SendGoalOptions{goal_response_callback, feedback_callback, result_callback} analogue). Goal-response / feedback / result are delivered to the closures at spin_once. Returns an ActionClientCallback send handle (send_goal / get_result); dual-mode — the Promise-based create_action_client is unchanged.

Source

pub fn create_action_client_with_callbacks_sized<A, GRespF, FbF, ResF, const GOAL_BUF: usize, const RESULT_BUF: usize, const FEEDBACK_BUF: usize>( &mut self, action_name: &str, on_goal_response: GRespF, on_feedback: FbF, on_result: ResF, ) -> Result<ActionClientCallback<A, GOAL_BUF, RESULT_BUF, FEEDBACK_BUF>, NodeError>
where A: RosAction + 'static, <A as RosAction>::Goal: MessageForRmw, <A as RosAction>::Result: MessageForRmw, <A as RosAction>::Feedback: MessageForRmw, GRespF: FnMut(&GoalId, bool) + 'static, FbF: FnMut(&GoalId, &<A as RosAction>::Feedback) + 'static, ResF: FnMut(&GoalId, GoalStatus, &<A as RosAction>::Result) + 'static,

Callback-based action client with custom buffer sizes (Phase 239.2).

Source

pub fn create_generic_subscription<F>( &mut self, topic: &str, type_name: &str, type_hash: &str, callback: F, ) -> Result<HandleId, NodeError>
where F: FnMut(&[u8]) + 'static,

Convenient generic (type-erased) subscription — rclcpp create_generic_*.

Source

pub fn create_generic_subscription_with_qos<F>( &mut self, topic: &str, type_name: &str, type_hash: &str, qos: QoSProfile, callback: F, ) -> Result<HandleId, NodeError>
where F: FnMut(&[u8]) + 'static,

Issue 0306 — the same, with an explicit profile (see Self::create_generic_publisher_with_qos for why).

Source

pub fn create_subscription_viewable<B, F>( &mut self, topic: &str, callback: F, ) -> Result<HandleId, NodeError>
where B: ViewableMessage + 'static, F: for<'a> FnMut(&<B as ViewableMessage>::View<'a>) + 'static,

Convenient zero-copy subscription (Phase 229.6, issue 0007 / RFC-0033 view mode).

B is the code-generated VIEWABLE marker (e.g. ImageViewable, emitted alongside the inline Image for a .msg with a view-mode field). The marker is zero-sized and carries NO lifetime, which is the whole reason it exists: B::View<'a> does, and a generic parameter cannot be the lifetime-carrying type itself. That is also why phase-390 could not simply rename it to {Msg}View — the view struct already owns that name, and the marker points AT it.

The callback receives &B::View<'a> — a message whose unbounded sequence/string fields point directly into the receive buffer (no heapless::Vec copy); valid only for the callback’s duration.

Uses KEEP_LAST(1) QoS → triple buffer, as view subscriptions require (a single well-defined slot for the callback). For an explicit deeper queue use the inline create_subscription; a view subscription registered with KEEP_LAST(N>1) is rejected.

Source

pub fn service<'t>( &mut self, name: &'t str, ) -> CtxServiceBuilder<'_, 'e, 't, 's>

Service-server builder (the clone tier) — node.service(name). Set .qos() (defaults to the services profile = RELIABLE+VOLATILE+ KEEP_LAST(10)), then .build::<Svc, _>(callback) (Phase 193.2).

Source

pub fn create_service<Svc, F>( &mut self, name: &str, callback: F, ) -> Result<HandleId, NodeError>
where Svc: RosService + 'static, <Svc as RosService>::Request: MessageForRmw, <Svc as RosService>::Reply: MessageForRmw, F: FnMut(&<Svc as RosService>::Request) -> <Svc as RosService>::Reply + 'static,

Convenient service server (the fork tier — rclrs/rclcpp shape), default services QoS. Mirror of create_subscription.

Source

pub fn get_node_names( &mut self, visit: &mut dyn FnMut(&str, &str) -> bool, ) -> Result<(), NodeError>

Every node on the graph, with its namespace — rclrs’s Node::get_node_names.

visit(name, namespace) once per node. For the enclave as well, use get_node_names_with_enclaves: one backend slot answers both, exactly as rmw_get_node_names and rmw_get_node_names_with_enclaves are one query upstream.

Reports what has been DISCOVERED and never blocks, so an empty enumeration means “nobody seen yet”, not “nobody exists”; Err(Transport(Unsupported)) from a backend with no graph is a different answer from empty. See the module note above.

Source

pub fn get_node_names_with_enclaves( &mut self, visit: &mut dyn FnMut(&str, &str, Option<&str>) -> bool, ) -> Result<(), NodeError>

Every node on the graph with its namespace AND its enclave — rclrs’s Node::get_node_names_with_enclaves.

visit(name, namespace, enclave). enclave is None when the backend reports the node but not its enclave, which is a partial answer rather than an error — reporting the node without the enclave beats dropping it. Same discovery envelope as get_node_names.

Source

pub fn get_topic_names_and_types( &mut self, visit: &mut dyn FnMut(&str, &[&str]) -> bool, ) -> Result<(), NodeError>

Every topic on the graph, with the types on it — rclrs’s Node::get_topic_names_and_types.

visit(topic_name, types) once per distinct TOPIC: a topic carrying two types is one call with two entries, not two calls. types may legitimately be empty on a partially discovered graph. Same discovery envelope as get_node_names.

Source

pub fn get_service_names_and_types( &mut self, visit: &mut dyn FnMut(&str, &[&str]) -> bool, ) -> Result<(), NodeError>

Every service on the graph, with its types — rclrs’s Node::get_service_names_and_types. As get_topic_names_and_types, over servers and clients.

Source

pub fn count_publishers(&mut self, topic_name: &str) -> Result<usize, NodeError>

How many publishers are visible on topic_name — rclrs’s Node::count_publishers.

This is the GRAPH’s count, not this node’s. The number of publishers this node itself DECLARED is StandaloneNode::publisher_count, a different question with a different answer.

A count reflects what has been DISCOVERED, so it can be low right after startup and is never a proof of absence. See get_node_names.

Source

pub fn count_subscriptions( &mut self, topic_name: &str, ) -> Result<usize, NodeError>

How many subscriptions are visible on topic_name — rclrs’s Node::count_subscriptions.

subscriptions, not subscribers — this is rclrs’s spelling, and the Rust surface takes its vocabulary from rclrs so a user porting Rust ROS 2 code types what they already know. The C surface says subscribers because rcl does, and the vtable slot says subscribers because upstream rmw does. Three layers, three upstreams, one word each — not drift.

The graph’s count, not this node’s; see count_publishers for that distinction and for the discovery caveats.

Source

pub fn get_publisher_names_and_types_by_node( &mut self, node_name: &str, node_namespace: &str, visit: &mut dyn FnMut(&str, &[&str]) -> bool, ) -> Result<(), NodeError>

What one named node PUBLISHES, with the types — rclrs’s Node::get_publisher_names_and_types_by_node.

A node the graph has not discovered yields no visits, which is not an error — see get_node_names for why an empty answer means “not seen yet”.

Source

pub fn get_subscription_names_and_types_by_node( &mut self, node_name: &str, node_namespace: &str, visit: &mut dyn FnMut(&str, &[&str]) -> bool, ) -> Result<(), NodeError>

What one named node SUBSCRIBES to, with the types — rclrs’s Node::get_subscription_names_and_types_by_node. See count_subscriptions on the spelling.

Source

pub fn get_service_names_and_types_by_node( &mut self, node_name: &str, node_namespace: &str, visit: &mut dyn FnMut(&str, &[&str]) -> bool, ) -> Result<(), NodeError>

What services one named node SERVES, with the types — rclrs’s Node::get_service_names_and_types_by_node.

Source

pub fn get_client_names_and_types_by_node( &mut self, node_name: &str, node_namespace: &str, visit: &mut dyn FnMut(&str, &[&str]) -> bool, ) -> Result<(), NodeError>

What services one named node CALLS, with the types — rclrs’s Node::get_client_names_and_types_by_node.

Source

pub fn get_publishers_info_by_topic( &mut self, topic_name: &str, visit: &mut dyn FnMut(&GraphEndpointInfo<'_>) -> bool, ) -> Result<(), NodeError>

The PUBLISHERS on topic_name, one visit each — rclrs’s Node::get_publishers_info_by_topic.

The last two members of the graph family to reach upstream’s receiver. visit(info) per discovered endpoint; every &str on the GraphEndpointInfo is BORROWED for the duration of that call, so copy anything you keep, and returning false stops the walk.

ADOPT-BOUNDED: rclrs returns an owned Vec<TopicEndpointInfo>; here the answer is STREAMED to visit, because the graph has no bound a caller could size a buffer to and there is no allocator for a Vec. It reports what has been DISCOVERED and never blocks, so an empty walk means “nobody seen yet”; a backend with no graph answers Err(Transport(Unsupported)), never an empty Ok.

It carries NO QoS, and that absence is the point: the GRANTED profile is what answers “why is nothing arriving”, no backend can read a remote’s back yet, and reporting the remote’s DECLARED profile instead would be the confident wrong answer the field exists to avoid.

Source

pub fn get_subscriptions_info_by_topic( &mut self, topic_name: &str, visit: &mut dyn FnMut(&GraphEndpointInfo<'_>) -> bool, ) -> Result<(), NodeError>

The SUBSCRIPTIONS on topic_name, one visit each — rclrs’s Node::get_subscriptions_info_by_topic. See get_publishers_info_by_topic.

Same envelope: STREAMED to visit rather than returned as a Vec, every &str borrowed for the visit, discovered-only and non-blocking, and Err(Transport(Unsupported)) from a backend with no graph.

Source

pub fn create_publisher_with_qos<M>( &mut self, topic_name: &str, qos: QoSProfile, ) -> Result<EmbeddedPublisher<M>, NodeError>
where M: MessageForRmw,

create_publisher with an explicit profile (phase-483 W2).

Through NodeHandle::create_publisher_with_qos, so a publisher made here gets what one made on the handle Executor::create_node used to return: the node’s remap rules (launch, then --ros-args), the plan’s QoS overrides and the declared-QoS check. Executor::create_publisher_on takes a name its caller already resolved, which is right for the C and component roads and wrong for a user’s source name.

Source

pub fn create_publisher_raw( &mut self, topic_name: &str, type_name: &str, type_hash: &str, ) -> Result<EmbeddedRawPublisher, NodeError>

NodeHandle::create_publisher_raw on this node (phase-483 W2).

Source

pub fn create_publisher_raw_with_qos( &mut self, topic_name: &str, type_name: &str, type_hash: &str, qos: QoSProfile, ) -> Result<EmbeddedRawPublisher, NodeError>

NodeHandle::create_publisher_raw_with_qos on this node (phase-483 W2).

Source

pub fn create_polling_subscription<M>( &mut self, topic_name: &str, ) -> Result<Subscription<M>, NodeError>
where M: MessageForRmw,

The POLLED form of NodeHandle::create_subscription (phase-483 W2): the caller takes from it, where rclrs’s create_subscription takes a callback.

Source

pub fn create_polling_subscription_sized<M, const RX_BUF: usize>( &mut self, topic_name: &str, ) -> Result<Subscription<M, RX_BUF>, NodeError>
where M: MessageForRmw,

The POLLED form of NodeHandle::create_subscription_sized (phase-483 W2): the caller takes from it, where rclrs’s create_subscription takes a callback.

Source

pub fn create_polling_subscription_with_qos<M, const RX_BUF: usize>( &mut self, topic_name: &str, qos: QoSProfile, ) -> Result<Subscription<M, RX_BUF>, NodeError>
where M: MessageForRmw,

The POLLED form of NodeHandle::create_subscription_with_qos (phase-483 W2): the caller takes from it, where rclrs’s create_subscription takes a callback.

Source

pub fn create_polling_subscription_raw( &mut self, topic_name: &str, type_name: &str, type_hash: &str, ) -> Result<RawSubscription, NodeError>

The POLLED form of NodeHandle::create_subscription_raw (phase-483 W2): the caller takes from it, where rclrs’s create_subscription takes a callback.

Source

pub fn create_polling_subscription_raw_sized<const RX_BUF: usize>( &mut self, topic_name: &str, type_name: &str, type_hash: &str, ) -> Result<RawSubscription<RX_BUF>, NodeError>

The POLLED form of NodeHandle::create_subscription_raw_sized (phase-483 W2): the caller takes from it, where rclrs’s create_subscription takes a callback.

Source

pub fn create_polling_service<Svc>( &mut self, service_name: &str, ) -> Result<EmbeddedServiceServer<Svc>, NodeError>

The POLLED form of NodeHandle::create_service (phase-483 W2): the caller takes from it, where rclrs’s create_service takes a callback.

Source

pub fn create_polling_service_with_qos<Svc>( &mut self, service_name: &str, qos: QoSProfile, ) -> Result<EmbeddedServiceServer<Svc>, NodeError>

The POLLED form of NodeHandle::create_service_with_qos (phase-483 W2): the caller takes from it, where rclrs’s create_service takes a callback.

Source

pub fn create_polling_service_sized<Svc, const REQ_BUF: usize, const REPLY_BUF: usize>( &mut self, service_name: &str, qos: QoSProfile, ) -> Result<EmbeddedServiceServer<Svc, REQ_BUF, REPLY_BUF>, NodeError>

The POLLED form of NodeHandle::create_service_sized (phase-483 W2): the caller takes from it, where rclrs’s create_service takes a callback.

Source

pub fn create_client<Svc>( &mut self, service_name: &str, ) -> Result<EmbeddedServiceClient<Svc>, NodeError>

NodeHandle::create_client on this node (phase-483 W2).

Source

pub fn create_client_with_qos<Svc>( &mut self, service_name: &str, qos: QoSProfile, ) -> Result<EmbeddedServiceClient<Svc>, NodeError>

NodeHandle::create_client_with_qos on this node (phase-483 W2).

Source

pub fn create_client_sized<Svc, const REQ_BUF: usize, const REPLY_BUF: usize>( &mut self, service_name: &str, qos: QoSProfile, ) -> Result<EmbeddedServiceClient<Svc, REQ_BUF, REPLY_BUF>, NodeError>

NodeHandle::create_client_sized on this node (phase-483 W2).

Source

pub fn create_polling_service_raw( &mut self, service_name: &str, type_name: &str, type_hash: &str, ) -> Result<RawServiceServer, NodeError>

The POLLED form of NodeHandle::create_service_raw (phase-483 W2): the caller takes from it, where rclrs’s create_service takes a callback.

Source

pub fn create_polling_service_raw_sized<const REQ_BUF: usize, const RESP_BUF: usize>( &mut self, service_name: &str, type_name: &str, type_hash: &str, ) -> Result<RawServiceServer<REQ_BUF, RESP_BUF>, NodeError>

The POLLED form of NodeHandle::create_service_raw_sized (phase-483 W2): the caller takes from it, where rclrs’s create_service takes a callback.

Source

pub fn create_client_raw( &mut self, service_name: &str, type_name: &str, type_hash: &str, ) -> Result<RawServiceClient, NodeError>

NodeHandle::create_client_raw on this node (phase-483 W2).

Source

pub fn create_client_raw_sized<const REQ_BUF: usize, const REPLY_BUF: usize>( &mut self, service_name: &str, type_name: &str, type_hash: &str, ) -> Result<RawServiceClient<REQ_BUF, REPLY_BUF>, NodeError>

NodeHandle::create_client_raw_sized on this node (phase-483 W2).

Source

pub fn create_action_server_raw( &mut self, action_name: &str, type_name: &str, type_hash: &str, ) -> Result<ActionServerCore<nros_node::::executor::node::{impl#5}::create_action_server_raw::{constant#0}, nros_node::::executor::node::{impl#5}::create_action_server_raw::{constant#1}, nros_node::::executor::node::{impl#5}::create_action_server_raw::{constant#2}>, NodeError>

NodeHandle::create_action_server_raw on this node (phase-483 W2).

Source

pub fn create_action_server_raw_sized<const GOAL_BUF: usize, const RESULT_BUF: usize, const FEEDBACK_BUF: usize, const MAX_GOALS: usize>( &mut self, action_name: &str, type_name: &str, type_hash: &str, ) -> Result<ActionServerCore<GOAL_BUF, RESULT_BUF, FEEDBACK_BUF, MAX_GOALS>, NodeError>

NodeHandle::create_action_server_raw_sized on this node (phase-483 W2).

Source

pub fn create_action_client_raw( &mut self, action_name: &str, type_name: &str, type_hash: &str, ) -> Result<ActionClientCore<nros_node::::executor::node::{impl#5}::create_action_client_raw::{constant#0}, nros_node::::executor::node::{impl#5}::create_action_client_raw::{constant#1}, nros_node::::executor::node::{impl#5}::create_action_client_raw::{constant#2}>, NodeError>

NodeHandle::create_action_client_raw on this node (phase-483 W2).

Source

pub fn create_action_client_raw_sized<const GOAL_BUF: usize, const RESULT_BUF: usize, const FEEDBACK_BUF: usize>( &mut self, action_name: &str, type_name: &str, type_hash: &str, ) -> Result<ActionClientCore<GOAL_BUF, RESULT_BUF, FEEDBACK_BUF>, NodeError>

NodeHandle::create_action_client_raw_sized on this node (phase-483 W2).

Source

pub fn create_action_server<A>( &mut self, action_name: &str, ) -> Result<ActionServer<A>, NodeError>

NodeHandle::create_action_server on this node (phase-483 W2).

Source

pub fn create_action_server_sized<A, const GOAL_BUF: usize, const RESULT_BUF: usize, const FEEDBACK_BUF: usize, const MAX_GOALS: usize>( &mut self, action_name: &str, ) -> Result<ActionServer<A, GOAL_BUF, RESULT_BUF, FEEDBACK_BUF, MAX_GOALS>, NodeError>

NodeHandle::create_action_server_sized on this node (phase-483 W2).

Source

pub fn create_action_client<A>( &mut self, action_name: &str, ) -> Result<ActionClient<A>, NodeError>

NodeHandle::create_action_client on this node (phase-483 W2).

Source

pub fn create_action_client_sized<A, const GOAL_BUF: usize, const RESULT_BUF: usize, const FEEDBACK_BUF: usize>( &mut self, action_name: &str, ) -> Result<ActionClient<A, GOAL_BUF, RESULT_BUF, FEEDBACK_BUF>, NodeError>

NodeHandle::create_action_client_sized on this node (phase-483 W2).

Trait Implementations§

Source§

impl DeclarativeNode for Node<'_, 'static>

Available on crate feature rmw-cffi only.
Source§

fn callback_group(&mut self, group: &str) -> NodeResult<&mut Self>
where Self: Sized,

Set the sticky callback-group label applied to every entity declared after this call (until changed again). The group is the symbolic name the node author exposes; system.toml maps it to a scheduling tier (RFC-0015). Entities declared while no group is set remain unlabeled (wildcard-eligible).
Source§

fn create_publisher_for_topic<'entity, M: MessageForRmw>( &mut self, topic: &'entity str, ) -> NodeResult<NodePublisher<'entity, M>>

Declare a publisher using topic as the stable entity ID. Read more
Source§

fn create_publisher_for_topic_with_qos<'entity, M: MessageForRmw>( &mut self, topic: &'entity str, qos: QoSProfile, ) -> NodeResult<NodePublisher<'entity, M>>

Declare a publisher with explicit QoS, using topic as the stable entity ID.
Source§

fn create_subscription_for_callback_name<'callback, M: MessageForRmw>( &mut self, callback_name: &'callback str, topic: &str, ) -> NodeResult<NodeSubscription<'callback, M>>

Declare a subscription using callback_name as the source callback name and synthesized entity ID.
Source§

fn create_subscription_for_callback_name_with_safety<'callback, M: MessageForRmw>( &mut self, callback_name: &'callback str, topic: &str, ) -> NodeResult<NodeSubscription<'callback, M>>

Phase 250 (Wave 2b) — declare a subscription with E2E message-integrity validation enabled (the declarative .safety() opt-in). Identical to create_subscription_for_callback_name but flags the entity so the runtime registers it via create_generic_subscription_with_integrity; the callback then reads CallbackCtx::integrity alongside the message. The config-driven [safety] axis (Wave 4 codegen) emits this call; it is also usable by hand. Ungated — when safety-e2e is off the flag is simply ignored and the subscription registers as a basic one.
Source§

fn create_subscription_for_topic<'entity, M: MessageForRmw>( &mut self, topic: &'entity str, ) -> NodeResult<NodeSubscription<'entity, M>>

Declare a subscription using topic as both the stable entity ID and callback ID.
Source§

fn create_subscription_for_topic_with_qos<'entity, M: MessageForRmw>( &mut self, topic: &'entity str, qos: QoSProfile, ) -> NodeResult<NodeSubscription<'entity, M>>

Declare a subscription with explicit QoS, using topic as both IDs.
Source§

fn create_subscription_static<M: MessageForRmw>( &mut self, topic: &'static str, ) -> NodeResult<SubscriptionTag>

Declare a subscription whose stable entity and callback IDs are both synthesized from the topic literal, returning a SubscriptionTag the Node author stores on Self::State and matches against the Callback<'_> delivered to ExecutableNode::on_callback. Read more
Source§

fn create_timer_for_callback_name<'callback>( &mut self, callback_name: &'callback str, period: TimerDuration, ) -> NodeResult<NodeTimer<'callback>>

Declare a timer using callback_name as the source callback name and synthesized entity ID.
Source§

fn create_timer_for_callback_name_on_clock<'callback>( &mut self, callback_name: &'callback str, period: TimerDuration, clock: TimerClockSource, ) -> NodeResult<NodeTimer<'callback>>

declare_timer_on_clock using callback_name as the source callback name and synthesized entity ID — the spelling a nros::main! component writes: Read more
Source§

fn create_service_server_for_name<'entity, S: RosService<Request: MessageForRmw, Reply: MessageForRmw>>( &mut self, name: &'entity str, ) -> NodeResult<NodeServiceServer<'entity, S>>

Declare a service server using name as both the stable entity ID and callback ID.
Source§

fn create_service_server_for_name_with_callback<'entity, S: RosService<Request: MessageForRmw, Reply: MessageForRmw>>( &mut self, name: &'entity str, callback_name: &str, ) -> NodeResult<NodeServiceServer<'entity, S>>

Declare a service server using name as the stable entity ID and callback_name as the source callback name.
Source§

fn create_service_static<S: RosService<Request: MessageForRmw, Reply: MessageForRmw>>( &mut self, name: &'static str, ) -> NodeResult<ServiceTag>

Declare a service server whose stable entity and callback IDs are both synthesized from the service-name literal, returning a ServiceTag the Node author stores on Self::State and matches against the Callback<'_> delivered to ExecutableNode::on_callback. Read more
Source§

fn create_service_client_for_name<'entity, S: RosService<Request: MessageForRmw, Reply: MessageForRmw>>( &mut self, name: &'entity str, ) -> NodeResult<NodeServiceClient<'entity, S>>

Declare a service client using name as the stable entity ID.
Source§

fn create_action_server_for_name<'entity, A: RosAction<Goal: MessageForRmw, Result: MessageForRmw, Feedback: MessageForRmw, SendGoalRequest: MessageForRmw, SendGoalResponse: MessageForRmw, GetResultRequest: MessageForRmw, GetResultResponse: MessageForRmw, FeedbackMessage: MessageForRmw>>( &mut self, name: &'entity str, ) -> NodeResult<NodeActionServer<'entity, A>>

Declare an action server using name as the stable entity ID and default goal/cancel/accepted callback ID.
Source§

fn create_action_server_for_name_with_callbacks<'entity, A: RosAction<Goal: MessageForRmw, Result: MessageForRmw, Feedback: MessageForRmw, SendGoalRequest: MessageForRmw, SendGoalResponse: MessageForRmw, GetResultRequest: MessageForRmw, GetResultResponse: MessageForRmw, FeedbackMessage: MessageForRmw>>( &mut self, name: &'entity str, goal_callback_name: &str, cancel_callback_name: &str, accepted_callback_name: &str, ) -> NodeResult<NodeActionServer<'entity, A>>

Declare an action server using name as the stable entity ID and explicit source callback names for goal, cancel, and accepted events.
Source§

fn create_action_static<A: RosAction<Goal: MessageForRmw, Result: MessageForRmw, Feedback: MessageForRmw, SendGoalRequest: MessageForRmw, SendGoalResponse: MessageForRmw, GetResultRequest: MessageForRmw, GetResultResponse: MessageForRmw, FeedbackMessage: MessageForRmw>>( &mut self, name: &'static str, ) -> NodeResult<ActionTag>

Declare an action server whose stable entity and callback IDs are both synthesized from the action-name literal, returning an ActionTag the Node author stores on Self::State and matches against the Callback<'_> delivered to ExecutableNode::on_callback. Read more
Source§

fn create_action_client_for_name<'entity, A: RosAction<Goal: MessageForRmw, Result: MessageForRmw, Feedback: MessageForRmw, SendGoalRequest: MessageForRmw, SendGoalResponse: MessageForRmw, GetResultRequest: MessageForRmw, GetResultResponse: MessageForRmw, FeedbackMessage: MessageForRmw>>( &mut self, name: &'entity str, ) -> NodeResult<NodeActionClient<'entity, A>>

Declare an action client using name as the stable entity ID.
Source§

fn create_action_client_with_callbacks_for_name<'entity, A: RosAction<Goal: MessageForRmw, Result: MessageForRmw, Feedback: MessageForRmw, SendGoalRequest: MessageForRmw, SendGoalResponse: MessageForRmw, GetResultRequest: MessageForRmw, GetResultResponse: MessageForRmw, FeedbackMessage: MessageForRmw>>( &mut self, name: &'entity str, result_callback_name: &str, feedback_callback_name: &str, ) -> NodeResult<NodeActionClient<'entity, A>>

Declare an action client that delivers the goal RESULT + FEEDBACK to named callbacks (Phase 212.M-F.23). name is the stable entity ID. The executor auto-drives accept → feedback stream → result during spin and dispatches ExecutableNode::on_callback with result_callback_name (payload = result CDR) on completion, and with feedback_callback_name (payload = feedback CDR) per feedback message. Read either with CallbackCtx::message::<A::Result>() / ::<A::Feedback>(). Without these the client can only send_goal; result + feedback are dropped. Read more
Source§

fn declare_parameter_for_name<'entity>( &mut self, name: &'entity str, parameter_type: ParameterType, ) -> NodeResult<NodeParameter<'entity>>

Declare a parameter using name as the generated stable entity ID.
Source§

fn declare_parameter_for_name_with_default<'entity>( &mut self, name: &'entity str, default: ParameterDefault, ) -> NodeResult<NodeParameter<'entity>>

Declare a parameter with a concrete source default, using name as the generated stable entity ID.
Source§

fn callback_for_name<'callback>( &mut self, name: &'callback str, ) -> CallbackEffects<'_, 'callback>

Record optional effects for a named callback without exposing CallbackId at the declaration site.

Auto Trait Implementations§

§

impl<'e, 's> !Sync for Node<'e, 's>

§

impl<'e, 's> !UnwindSafe for Node<'e, 's>

§

impl<'e, 's> Freeze for Node<'e, 's>

§

impl<'e, 's> RefUnwindSafe for Node<'e, 's>

§

impl<'e, 's> Send for Node<'e, 's>

§

impl<'e, 's> Unpin for Node<'e, 's>

§

impl<'e, 's> UnsafeUnpin for Node<'e, 's>

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.