Skip to main content

ActionInfo

Struct ActionInfo 

Source
pub struct ActionInfo<'a> {
    pub name: &'a str,
    pub type_name: &'a str,
    pub type_hash: &'a str,
    pub domain_id: u32,
}
Expand description

Action information for action client/server

Actions in ROS 2 use 5 communication channels:

  • send_goal service: <action_name>/_action/send_goal
  • cancel_goal service: <action_name>/_action/cancel_goal
  • get_result service: <action_name>/_action/get_result
  • feedback topic: <action_name>/_action/feedback
  • status topic: <action_name>/_action/status

Fields§

§name: &'a str

Action name (e.g., “/fibonacci”)

§type_name: &'a str

ROS action type name (e.g., “example_interfaces::action::dds_::Fibonacci_”)

§type_hash: &'a str

Type hash for compatibility checking

§domain_id: u32

Domain ID (default: 0)

Implementations§

Source§

impl<'a> ActionInfo<'a>

Source

pub const fn new( name: &'a str, type_name: &'a str, type_hash: &'a str, ) -> ActionInfo<'a>

Create new action info

Source

pub const fn with_domain(self, domain_id: u32) -> ActionInfo<'a>

Create action info with custom domain ID

Source

pub fn send_goal_key<const N: usize>(&self) -> String<N>

Generate the send_goal service name Returns: <action>/_action/send_goal

Source

pub fn cancel_goal_key<const N: usize>(&self) -> String<N>

Generate the cancel_goal service name Returns: <action>/_action/cancel_goal

Source

pub fn get_result_key<const N: usize>(&self) -> String<N>

Generate the get_result service name Returns: <action>/_action/get_result

Source

pub fn feedback_key<const N: usize>(&self) -> String<N>

Generate the feedback topic name Returns: <action>/_action/feedback

Source

pub fn status_key<const N: usize>(&self) -> String<N>

Generate the status topic name Returns: <action>/_action/status

Trait Implementations§

Source§

impl<'a> Clone for ActionInfo<'a>

Source§

fn clone(&self) -> ActionInfo<'a>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Debug for ActionInfo<'a>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for ActionInfo<'a>

§

impl<'a> RefUnwindSafe for ActionInfo<'a>

§

impl<'a> Send for ActionInfo<'a>

§

impl<'a> Sync for ActionInfo<'a>

§

impl<'a> Unpin for ActionInfo<'a>

§

impl<'a> UnsafeUnpin for ActionInfo<'a>

§

impl<'a> UnwindSafe for ActionInfo<'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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.