pub struct ServiceInfo<'a> {
pub name: &'a str,
pub type_name: &'a str,
pub type_hash: &'a str,
pub domain_id: u32,
pub node_name: Option<&'a str>,
pub namespace: &'a str,
}Expand description
Service information for service client/server
Fields§
§name: &'a strService name (e.g., “/add_two_ints”)
type_name: &'a strROS service type name (e.g., “example_interfaces::srv::dds_::AddTwoInts_”)
type_hash: &'a strType hash for compatibility checking
domain_id: u32Domain ID (default: 0)
node_name: Option<&'a str>Node name for liveliness token generation.
None means no node association — no liveliness token will be declared.
namespace: &'a strNode namespace for liveliness token generation (default: “/”). In ROS 2, “/” is the root namespace and the standard default.
Implementations§
Source§impl<'a> ServiceInfo<'a>
impl<'a> ServiceInfo<'a>
Sourcepub const fn new(
name: &'a str,
type_name: &'a str,
type_hash: &'a str,
) -> ServiceInfo<'a>
pub const fn new( name: &'a str, type_name: &'a str, type_hash: &'a str, ) -> ServiceInfo<'a>
Create new service info
Sourcepub const fn with_domain(self, domain_id: u32) -> ServiceInfo<'a>
pub const fn with_domain(self, domain_id: u32) -> ServiceInfo<'a>
Create service info with custom domain ID
Sourcepub const fn with_node_name(self, node_name: &'a str) -> ServiceInfo<'a>
pub const fn with_node_name(self, node_name: &'a str) -> ServiceInfo<'a>
Set the node name for liveliness token generation
Sourcepub const fn with_namespace(self, namespace: &'a str) -> ServiceInfo<'a>
pub const fn with_namespace(self, namespace: &'a str) -> ServiceInfo<'a>
Set the node namespace for liveliness token generation
Trait Implementations§
Source§impl<'a> Clone for ServiceInfo<'a>
impl<'a> Clone for ServiceInfo<'a>
Source§fn clone(&self) -> ServiceInfo<'a>
fn clone(&self) -> ServiceInfo<'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 ServiceInfo<'a>
impl<'a> RefUnwindSafe for ServiceInfo<'a>
impl<'a> Send for ServiceInfo<'a>
impl<'a> Sync for ServiceInfo<'a>
impl<'a> Unpin for ServiceInfo<'a>
impl<'a> UnsafeUnpin for ServiceInfo<'a>
impl<'a> UnwindSafe for ServiceInfo<'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