pub struct DeclaredNode<'ctx, 'id, R: NodeRuntime + ?Sized = dyn NodeRuntime + 'ctx> { /* private fields */ }Expand description
Declared component node.
Implementations§
Source§impl<'ctx, 'id, R: NodeRuntime + ?Sized> DeclaredNode<'ctx, 'id, R>
impl<'ctx, 'id, R: NodeRuntime + ?Sized> DeclaredNode<'ctx, 'id, R>
Sourcepub fn callback_group(&mut self, group: &str) -> NodeResult<&mut Self>
pub fn callback_group(&mut self, group: &str) -> NodeResult<&mut Self>
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). Reusing the Phase-216 tag
string as the group id keeps one identifier per logical callback.
Sourcepub fn create_publisher_for_topic<'entity, M: RosMessage>(
&mut self,
topic: &'entity str,
) -> NodeResult<NodePublisher<'entity, M>>
pub fn create_publisher_for_topic<'entity, M: RosMessage>( &mut self, topic: &'entity str, ) -> NodeResult<NodePublisher<'entity, M>>
Declare a publisher using topic as the stable entity ID.
Use the explicit create_publisher form when
a node declares more than one publisher on the same topic or needs a
stable metadata ID that differs from the ROS topic name.
Sourcepub fn create_publisher_for_topic_with_qos<'entity, M: RosMessage>(
&mut self,
topic: &'entity str,
qos: QosSettings,
) -> NodeResult<NodePublisher<'entity, M>>
pub fn create_publisher_for_topic_with_qos<'entity, M: RosMessage>( &mut self, topic: &'entity str, qos: QosSettings, ) -> NodeResult<NodePublisher<'entity, M>>
Declare a publisher with explicit QoS, using topic as the stable entity ID.
Sourcepub fn create_subscription_for_callback_name<'callback, M: RosMessage>(
&mut self,
callback_name: &'callback str,
topic: &str,
) -> NodeResult<NodeSubscription<'callback, M>>
pub fn create_subscription_for_callback_name<'callback, M: RosMessage>( &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.
Sourcepub fn create_subscription_for_callback_name_with_safety<'callback, M: RosMessage>(
&mut self,
callback_name: &'callback str,
topic: &str,
) -> NodeResult<NodeSubscription<'callback, M>>
pub fn create_subscription_for_callback_name_with_safety<'callback, M: RosMessage>( &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.
Sourcepub fn create_subscription_for_topic<'entity, M: RosMessage>(
&mut self,
topic: &'entity str,
) -> NodeResult<NodeSubscription<'entity, M>>
pub fn create_subscription_for_topic<'entity, M: RosMessage>( &mut self, topic: &'entity str, ) -> NodeResult<NodeSubscription<'entity, M>>
Declare a subscription using topic as both the stable entity ID and callback ID.
Sourcepub fn create_subscription_for_topic_with_qos<'entity, M: RosMessage>(
&mut self,
topic: &'entity str,
qos: QosSettings,
) -> NodeResult<NodeSubscription<'entity, M>>
pub fn create_subscription_for_topic_with_qos<'entity, M: RosMessage>( &mut self, topic: &'entity str, qos: QosSettings, ) -> NodeResult<NodeSubscription<'entity, M>>
Declare a subscription with explicit QoS, using topic as both IDs.
Sourcepub fn create_subscription_static<M: RosMessage>(
&mut self,
topic: &'static str,
) -> NodeResult<SubscriptionTag>
pub fn create_subscription_static<M: RosMessage>( &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.
Use this on the Phase 216.A Deferred Node path where the Node
author does not need to invent a separate stable entity ID — the
topic literal becomes both the entity ID and the callback ID,
and the returned tag preserves that identifier for compile-time
state.sub_chatter == cb matches in on_callback.
Sourcepub fn create_timer_for_callback_name<'callback>(
&mut self,
callback_name: &'callback str,
period: TimerDuration,
) -> NodeResult<NodeTimer<'callback>>
pub 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.
Sourcepub fn create_service_server_for_name<'entity, S: RosService>(
&mut self,
name: &'entity str,
) -> NodeResult<NodeServiceServer<'entity, S>>
pub fn create_service_server_for_name<'entity, S: RosService>( &mut self, name: &'entity str, ) -> NodeResult<NodeServiceServer<'entity, S>>
Declare a service server using name as both the stable entity ID
and callback ID.
Sourcepub fn create_service_server_for_name_with_callback<'entity, S: RosService>(
&mut self,
name: &'entity str,
callback_name: &str,
) -> NodeResult<NodeServiceServer<'entity, S>>
pub fn create_service_server_for_name_with_callback<'entity, S: RosService>( &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.
Sourcepub fn create_service_static<S: RosService>(
&mut self,
name: &'static str,
) -> NodeResult<ServiceTag>
pub fn create_service_static<S: RosService>( &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.
Tag-only registration is restricted to the SERVER side: clients
need a USABLE handle (NodeServiceClient) to issue requests, so
use the existing
create_service_client_for_name builder
for the client side.
Sourcepub fn create_service_client_for_name<'entity, S: RosService>(
&mut self,
name: &'entity str,
) -> NodeResult<NodeServiceClient<'entity, S>>
pub fn create_service_client_for_name<'entity, S: RosService>( &mut self, name: &'entity str, ) -> NodeResult<NodeServiceClient<'entity, S>>
Declare a service client using name as the stable entity ID.
Sourcepub fn create_action_server_for_name<'entity, A: RosAction>(
&mut self,
name: &'entity str,
) -> NodeResult<NodeActionServer<'entity, A>>
pub fn create_action_server_for_name<'entity, A: RosAction>( &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.
Sourcepub fn create_action_server_for_name_with_callbacks<'entity, A: RosAction>(
&mut self,
name: &'entity str,
goal_callback_name: &str,
cancel_callback_name: &str,
accepted_callback_name: &str,
) -> NodeResult<NodeActionServer<'entity, A>>
pub fn create_action_server_for_name_with_callbacks<'entity, A: RosAction>( &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.
Sourcepub fn create_action_static<A: RosAction>(
&mut self,
name: &'static str,
) -> NodeResult<ActionTag>
pub fn create_action_static<A: RosAction>( &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.
The synthesized callback ID is shared by the goal / cancel /
accepted callbacks (matching the default behavior of
create_action_server).
Tag-only registration is restricted to the SERVER side: clients
need a USABLE handle (NodeActionClient) to dispatch goals, so
use the existing
create_action_client_for_name builder
for the client side.
Sourcepub fn create_action_client_for_name<'entity, A: RosAction>(
&mut self,
name: &'entity str,
) -> NodeResult<NodeActionClient<'entity, A>>
pub fn create_action_client_for_name<'entity, A: RosAction>( &mut self, name: &'entity str, ) -> NodeResult<NodeActionClient<'entity, A>>
Declare an action client using name as the stable entity ID.
Sourcepub fn create_action_client_with_callbacks_for_name<'entity, A: RosAction>(
&mut self,
name: &'entity str,
result_callback_name: &str,
feedback_callback_name: &str,
) -> NodeResult<NodeActionClient<'entity, A>>
pub fn create_action_client_with_callbacks_for_name<'entity, A: RosAction>( &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.
(Layout note: the action-client variant reuses the server-side
action_accepted_callback_id metadata slot for the feedback callback —
that field is unused on a client, so no new schema field is needed.)
Sourcepub fn declare_parameter_for_name<'entity>(
&mut self,
name: &'entity str,
parameter_type: ParameterType,
) -> NodeResult<NodeParameter<'entity>>
pub 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.
Sourcepub fn declare_parameter_for_name_with_default<'entity>(
&mut self,
name: &'entity str,
default: ParameterDefault,
) -> NodeResult<NodeParameter<'entity>>
pub 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.
Sourcepub fn callback_for_name<'callback>(
&mut self,
name: &'callback str,
) -> CallbackEffects<'_, 'callback, R>
pub fn callback_for_name<'callback>( &mut self, name: &'callback str, ) -> CallbackEffects<'_, 'callback, R>
Record optional effects for a named callback without exposing
CallbackId at the declaration site.