* update routeguide * update helloworld * depend on tonic beta.1 * Apply suggestions from code review Co-Authored-By: Lucio Franco <[email protected]> Co-authored-by: Lucio Franco <[email protected]>
22 lines
497 B
Rust
22 lines
497 B
Rust
use hello_world::greeter_client::GreeterClient;
|
|
use hello_world::HelloRequest;
|
|
|
|
pub mod hello_world {
|
|
tonic::include_proto!("helloworld");
|
|
}
|
|
|
|
#[tokio::main]
|
|
async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|
let mut client = GreeterClient::connect("http://[::1]:50051").await?;
|
|
|
|
let request = tonic::Request::new(HelloRequest {
|
|
name: "Tonic".into(),
|
|
});
|
|
|
|
let response = client.say_hello(request).await?;
|
|
|
|
println!("RESPONSE={:?}", response);
|
|
|
|
Ok(())
|
|
}
|