pub struct Client<Srv> where
Srv: ServiceT + 'static, { /* private fields */ }
Expand description
Service client
Implementations
sourceimpl<Srv> Client<Srv> where
Srv: ServiceT,
impl<Srv> Client<Srv> where
Srv: ServiceT,
sourcepub async fn send_request(
&mut self,
request: &Srv::Request
) -> Result<Srv::Response>
pub async fn send_request(
&mut self,
request: &Srv::Request
) -> Result<Srv::Response>
Get the service name.
Examples
let mut client = node.create_client::<Empty>("service", &QoSProfile::default())?;
let res = client.send_request(&Empty_Request {}).await?;
sourcepub fn service_name(&self) -> Option<String>
pub fn service_name(&self) -> Option<String>
Get the service name.
Examples
let client = node.create_client::<Empty>("service", &QoSProfile::default())?;
assert_eq!(client.service_name().unwrap(), "/service");
sourcepub fn is_valid(&self) -> bool
pub fn is_valid(&self) -> bool
Get the service name.
Examples
let client = node.create_client::<Empty>("service", &QoSProfile::default())?;
assert!(client.is_valid());
sourcepub fn service_is_available(&self) -> Result<bool>
pub fn service_is_available(&self) -> Result<bool>
Get the service name.
Examples
let client = node.create_client::<Empty>("service", &QoSProfile::default())?;
println!("{}", client.service_is_available()?);
sourcepub fn wait_service(&self) -> Result<()>
pub fn wait_service(&self) -> Result<()>
Get the service name.
Examples
let client = node.create_client::<Empty>("service", &QoSProfile::default())?;
client.wait_service()?;
Auto Trait Implementations
impl<Srv> !RefUnwindSafe for Client<Srv>
impl<Srv> Send for Client<Srv>
impl<Srv> Sync for Client<Srv>
impl<Srv> Unpin for Client<Srv>
impl<Srv> !UnwindSafe for Client<Srv>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more