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_goalservice:<action_name>/_action/send_goalcancel_goalservice:<action_name>/_action/cancel_goalget_resultservice:<action_name>/_action/get_resultfeedbacktopic:<action_name>/_action/feedbackstatustopic:<action_name>/_action/status
Fields§
§name: &'a strAction name (e.g., “/fibonacci”)
type_name: &'a strROS action type name (e.g., “example_interfaces::action::dds_::Fibonacci_”)
type_hash: &'a strType hash for compatibility checking
domain_id: u32Domain ID (default: 0)
Implementations§
Source§impl<'a> ActionInfo<'a>
impl<'a> ActionInfo<'a>
Sourcepub const fn new(name: &'a str, type_name: &'a str, type_hash: &'a str) -> Self
pub const fn new(name: &'a str, type_name: &'a str, type_hash: &'a str) -> Self
Create new action info
Sourcepub const fn with_domain(self, domain_id: u32) -> Self
pub const fn with_domain(self, domain_id: u32) -> Self
Create action info with custom domain ID
Sourcepub fn send_goal_key<const N: usize>(&self) -> String<N>
pub fn send_goal_key<const N: usize>(&self) -> String<N>
Generate the send_goal service name
Returns: <action>/_action/send_goal
Sourcepub fn cancel_goal_key<const N: usize>(&self) -> String<N>
pub fn cancel_goal_key<const N: usize>(&self) -> String<N>
Generate the cancel_goal service name
Returns: <action>/_action/cancel_goal
Sourcepub fn get_result_key<const N: usize>(&self) -> String<N>
pub fn get_result_key<const N: usize>(&self) -> String<N>
Generate the get_result service name
Returns: <action>/_action/get_result
Sourcepub fn feedback_key<const N: usize>(&self) -> String<N>
pub fn feedback_key<const N: usize>(&self) -> String<N>
Generate the feedback topic name
Returns: <action>/_action/feedback
Sourcepub fn status_key<const N: usize>(&self) -> String<N>
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>
impl<'a> Clone for ActionInfo<'a>
Source§fn clone(&self) -> ActionInfo<'a>
fn clone(&self) -> ActionInfo<'a>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto 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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more