1 use helloworld_proto::helloworld::greeter_client::GreeterClient; 2 use helloworld_proto::helloworld::HelloRequest; 3 4 #[tokio::main] main() -> Result<(), Box<dyn std::error::Error>>5async fn main() -> Result<(), Box<dyn std::error::Error>> { 6 let mut client = GreeterClient::connect("http://[::1]:50051").await?; 7 8 let request = tonic::Request::new(HelloRequest { 9 name: "Tonic".into(), 10 }); 11 12 let response = client.say_hello(request).await?; 13 14 println!("RESPONSE={:?}", response); 15 16 Ok(()) 17 } 18