use tonic::{Request, Response, Status};
mod proto {
tonic::include_proto!("plugin");
}
pub const FILE_DESCRIPTOR_SET: &[u8] = tonic::include_file_descriptor_set!("plugin_descriptor");
pub use proto::plugin_server::PluginServer as Server;
use proto::{plugin_server::Plugin, Echo};
pub struct Service {}
#[tonic::async_trait]
impl Plugin for Service {
async fn plugin_echo(&self, req: Request<Echo>) -> Result<Response<Echo>, Status> {
Ok(Response::new(req.into_inner()))
}
async fn plugin_echo_loud(&self, req: Request<Echo>) -> Result<Response<Echo>, Status> {
use heck::ToShoutySnekCase;
let resp = Echo {
hiya_buddy: req.into_inner().hiya_buddy.TO_SHOUTY_SNEK_CASE(),
};
Ok(Response::new(resp))
}
}