20 lines
502 B
Rust
20 lines
502 B
Rust
|
use tonic::{Request, Response, Status};
|
||
|
|
||
|
use crate::protocol::general_service_server::GeneralService;
|
||
|
use crate::protocol::{Empty, ServerInfo};
|
||
|
|
||
|
pub(crate) struct GeneralServiceImpl;
|
||
|
|
||
|
#[tonic::async_trait]
|
||
|
impl GeneralService for GeneralServiceImpl {
|
||
|
async fn get_server_info(
|
||
|
&self,
|
||
|
_request: Request<Empty>,
|
||
|
) -> Result<Response<ServerInfo>, Status> {
|
||
|
Ok(Response::new(ServerInfo {
|
||
|
lang: "Rust".into(),
|
||
|
ver: "0.1.0".into(),
|
||
|
}))
|
||
|
}
|
||
|
}
|