implement last interop test

This commit is contained in:
Lucio Franco
2019-09-21 16:02:10 -06:00
parent 922e480cec
commit 782da6f0e5
5 changed files with 118 additions and 14 deletions
+11 -8
View File
@@ -5,16 +5,10 @@ use std::pin::Pin;
use std::time::{Duration, Instant};
use tonic::{Code, Request, Response, Status};
pub fn create() -> pb::server::TestServiceServer<TestService> {
server::TestServiceServer::new(TestService {
data: String::new(),
})
}
pub use pb::server::{TestServiceServer, UnimplementedServiceServer};
#[derive(Default, Clone)]
pub struct TestService {
data: String,
}
pub struct TestService;
type Result<T> = std::result::Result<Response<T>, Status>;
type Streaming<T> = Request<tonic::Streaming<T>>;
@@ -156,3 +150,12 @@ impl pb::server::TestService for TestService {
Err(Status::unimplemented(""))
}
}
pub struct UnimplementedService;
#[tonic::async_trait]
impl pb::server::UnimplementedService for UnimplementedService {
async fn unimplemented_call(&self, _req: Request<Empty>) -> Result<Empty> {
Err(Status::unimplemented(""))
}
}