More async macro

This commit is contained in:
Lucio Franco
2019-08-09 16:01:00 -04:00
parent 693bbe3acd
commit aef683fe35
3 changed files with 44 additions and 49 deletions
+3 -3
View File
@@ -2,13 +2,13 @@ pub use tower_grpc::*;
use std::future::Future;
use std::pin::Pin;
use std::sync::Arc;
pub type ResponseFuture<'a, T> = Pin<Box<dyn Future<Output = Result<T, Status>> + Send + 'a>>;
pub trait GrpcInnerService<Request> {
type Response;
type Future: Future<Output = Result<Self::Response, Status>>;
fn call<'a>(&'a mut self, request: Request) -> ResponseFuture<'a, Self::Response>
where
Self: 'a;
fn call(self: Arc<Self>, request: Request) -> Self::Future;
}