Skip to main content

Node

Struct Node 

Source
pub struct Node { /* private fields */ }
Expand description

A ROS 2 node.

Implementations§

Source§

impl Node

Source

pub fn namespace(&self) -> &str

Its namespace.

Source

pub fn name(&self) -> &str

Its name.

Source

pub fn expand(&self, topic: &str) -> Result<String>

The fully qualified name of a topic or service of this node (expand_topic_name).

Source

pub fn create_publisher( &self, topic: &str, ty: &MessageType, qos: &QosProfile, extra: &UserData, ) -> Result<RosPublisher>

A writer of the ROS 2 topic topic (expanded for this node) of message type ty, with the QoS of qos. Its USER_DATA is typehash=...; and the entries of extra.

Source

pub fn create_subscription( &self, topic: &str, ty: &MessageType, qos: &QosProfile, extra: &UserData, ) -> Result<RosSubscription>

A reader of the ROS 2 topic topic (expanded for this node) of message type ty, as Self::create_publisher a writer.

Source

pub fn create_writer( &self, dds_topic: &str, ty: &MessageType, qos: &QosProfile, extra: &UserData, ) -> Result<NodeWriter>

A writer of DDS topic dds_topic of ty, counted as this node’s: for the topics of services (rq/, rr/, service_to_dds) and others the helpers do not make.

Source

pub fn create_reader( &self, dds_topic: &str, ty: &MessageType, qos: &QosProfile, extra: &UserData, ) -> Result<NodeReader>

A reader of DDS topic dds_topic of ty, counted as this node’s.

Source

pub fn service_topics(&self, service: &str) -> Result<(String, String)>

The DDS topics of the requests and replies of service service (expanded for this node).

Trait Implementations§

Source§

impl Debug for Node

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Drop for Node

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 !RefUnwindSafe for Node

§

impl !UnwindSafe for Node

§

impl Forget for Node

§

impl Freeze for Node
where *const ArcInner<Context> is !null: Freeze, PhantomData<ArcInner<Context>>: Freeze, *const u8 is !null: Freeze, PhantomData<u8>: Freeze,

§

impl Move for Node

§

impl Send for Node
where Arc<Context>: Send, RawVecInner: Send,

§

impl Sync for Node
where Arc<Context>: Sync, RawVecInner: Sync,

§

impl Unpin for Node
where Arc<Context>: Unpin, *const u8 is !null: Unpin,

§

impl UnsafeUnpin for Node
where *const ArcInner<Context> is !null: UnsafeUnpin, PhantomData<ArcInner<Context>>: UnsafeUnpin, *const u8 is !null: UnsafeUnpin, PhantomData<u8>: UnsafeUnpin,

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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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.