Skip to main content

NodeContext

Struct NodeContext 

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

Source

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

Source

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

Source

pub const fn component_name(&self) -> &'static str

Source component name.

Source

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

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more

Auto Trait Implementations§

§

impl<'a> !Sync for NodeContext<'a>

§

impl<'a> !UnwindSafe for NodeContext<'a>

§

impl<'a> Freeze for NodeContext<'a>

§

impl<'a> RefUnwindSafe for NodeContext<'a>

§

impl<'a> Send for NodeContext<'a>

§

impl<'a> Unpin for NodeContext<'a>

§

impl<'a> UnsafeUnpin for NodeContext<'a>

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.