pub struct NodeContext<'a> { /* private fields */ }Expand description
Node declaration context — what a component’s
register receives.
phase-483 W3: it creates REAL nodes. create_node
returns a crate::Node, the same type Executor::create_node gives a
standalone program, so a component’s node code and a program’s node code
are one code. The component-only declarations are the
DeclarativeNode methods on that node.
Implementations§
Source§impl<'a> NodeContext<'a>
impl<'a> NodeContext<'a>
Sourcepub fn set_params(&mut self, params: &'a [(&'a str, &'a str)])
pub fn set_params(&mut self, params: &'a [(&'a str, &'a str)])
Phase 264 W4a — seed this node instance’s baked launch parameters (called by
install_node_typed_with_params before Component::register).
Sourcepub fn param(&self, name: &str) -> Option<&'a str>
pub fn param(&self, name: &str) -> Option<&'a str>
Phase 264 W4a — the baked initial value of launch parameter name, or
None if the launch declared no <param name="…"/> for this node
instance. Read in register() and parse/stash on State (RFC-0004 §10).
Sourcepub const fn component_name(&self) -> &'static str
pub const fn component_name(&self) -> &'static str
Source component name.
Sourcepub fn create_node(
&mut self,
options: NodeOptions<'_>,
) -> NodeResult<Node<'_, 'static>>
pub fn create_node( &mut self, options: NodeOptions<'_>, ) -> NodeResult<Node<'_, 'static>>
Create this component’s node — rclrs’s executor.create_node(options).
The node’s name is the launch file’s when it names one, otherwise
options.name, which is also the component-stable node id the
declarations are keyed on.
Trait Implementations§
Source§impl Drop for NodeContext<'_>
Available on crate feature rmw-cffi only.
impl Drop for NodeContext<'_>
rmw-cffi only.