Update http body

This commit is contained in:
Lucio Franco
2019-08-18 01:06:27 -04:00
parent 2ebad2d778
commit b2a9ab97d7
17 changed files with 146 additions and 369 deletions
+9 -1
View File
@@ -25,7 +25,7 @@ pub fn client(attr: TokenStream) -> TokenStream {
}
impl<T> #service_ident <T>
where T: tonic::GrpcService<tonic::body::BoxAsyncBody>,
where T: tonic::GrpcService<tonic::body::BoxBody>,
T::ResponseBody: tonic::body::Body + tonic::_codegen::HttpBody + Send + 'static,
<T::ResponseBody as tonic::_codegen::HttpBody>::Error: Into<tonic::error::Error> + Send,
<T::ResponseBody as tonic::_codegen::HttpBody>::Data: Send, {
@@ -36,6 +36,14 @@ pub fn client(attr: TokenStream) -> TokenStream {
#methods
}
impl<T: Clone> Clone for #service_ident <T> {
fn clone(&self) -> Self {
Self {
inner: self.inner.clone(),
}
}
}
};
TokenStream::from(output)
+1 -1
View File
@@ -95,7 +95,7 @@ pub(crate) fn generate(service: ServiceDef) -> TokenStream {
}
impl Service<http::Request<tower_h2::RecvBody>> for #service_server {
type Response = http::Response<tonic::BoxAsyncBody>;
type Response = http::Response<tonic::BoxBody>;
type Error = tonic::error::Never;
type Future = BoxFuture<Self::Response, Self::Error>;