Skip to main content

DeclaredNode

Struct DeclaredNode 

Source
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>

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.)

Source

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.

Source

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.

Source

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.

Auto Trait Implementations§

§

impl<'ctx, 'id, R> Freeze for DeclaredNode<'ctx, 'id, R>
where R: ?Sized,

§

impl<'ctx, 'id, R> RefUnwindSafe for DeclaredNode<'ctx, 'id, R>
where R: RefUnwindSafe + ?Sized,

§

impl<'ctx, 'id, R> Send for DeclaredNode<'ctx, 'id, R>
where R: Send + ?Sized,

§

impl<'ctx, 'id, R> Sync for DeclaredNode<'ctx, 'id, R>
where R: Sync + ?Sized,

§

impl<'ctx, 'id, R> Unpin for DeclaredNode<'ctx, 'id, R>
where R: ?Sized,

§

impl<'ctx, 'id, R> UnsafeUnpin for DeclaredNode<'ctx, 'id, R>
where R: ?Sized,

§

impl<'ctx, 'id, R = dyn NodeRuntime + 'ctx> !UnwindSafe for DeclaredNode<'ctx, 'id, R>

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.