1#[rustfmt::skip]
5pub mod helloworld;
6
7use tonic::{Request, Response, Status};
8
9#[derive(Default)]
10pub struct Empty {}
11
12impl Empty {
13 pub fn new() -> Self {
14 Self {}
15 }
16}
17
18#[tonic::async_trait]
19impl helloworld::greeter_server::Greeter for Empty {
20 async fn say_hello(
21 &self,
22 request: Request<helloworld::HelloRequest>,
23 ) -> Result<Response<helloworld::HelloReply>, Status> {
24 let reply = helloworld::HelloReply {
25 message: format!("Hello {}!", request.into_inner().name),
26 };
27
28 Ok(Response::new(reply))
29 }
30}