pub struct ReflectionClient { /* private fields */ }
Implementations§
Source§impl ReflectionClient
impl ReflectionClient
Sourcepub async fn new(endpoint: String) -> Result<Self, Box<dyn Error>>
pub async fn new(endpoint: String) -> Result<Self, Box<dyn Error>>
Examples found in repository?
examples/main.rs (line 7)
4async fn main() -> Result<(), Box<dyn std::error::Error>> {
5 let endpoint = "http://[::1]:4444";
6
7 let mut reflection_client = ReflectionClient::new(endpoint.to_string()).await?;
8 let services = reflection_client.list_services().await?;
9
10 for service in services {
11 println!("Service: {}", service.service);
12 println!("Package: {}", service.package);
13 for method in service.methods {
14 println!(" RPC Method: {}", method.name);
15 }
16 }
17
18 Ok(())
19}
pub async fn connect(addr: &str) -> Result<Self, Box<dyn Error>>
Sourcepub async fn list_services(
&mut self,
) -> Result<Vec<ServiceInfo>, Box<dyn Error>>
pub async fn list_services( &mut self, ) -> Result<Vec<ServiceInfo>, Box<dyn Error>>
Examples found in repository?
examples/main.rs (line 8)
4async fn main() -> Result<(), Box<dyn std::error::Error>> {
5 let endpoint = "http://[::1]:4444";
6
7 let mut reflection_client = ReflectionClient::new(endpoint.to_string()).await?;
8 let services = reflection_client.list_services().await?;
9
10 for service in services {
11 println!("Service: {}", service.service);
12 println!("Package: {}", service.package);
13 for method in service.methods {
14 println!(" RPC Method: {}", method.name);
15 }
16 }
17
18 Ok(())
19}
Auto Trait Implementations§
impl !Freeze for ReflectionClient
impl !RefUnwindSafe for ReflectionClient
impl Send for ReflectionClient
impl Sync for ReflectionClient
impl Unpin for ReflectionClient
impl !UnwindSafe for ReflectionClient
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request