Skip to content
This repository has been archived by the owner on Apr 16, 2020. It is now read-only.

impl Encodable<tower_hyper::Body> is missing #197

Open
dingxiangfei2009 opened this issue Aug 7, 2019 · 3 comments
Open

impl Encodable<tower_hyper::Body> is missing #197

dingxiangfei2009 opened this issue Aug 7, 2019 · 3 comments

Comments

@dingxiangfei2009
Copy link

dingxiangfei2009 commented Aug 7, 2019

In case that tower_hyper is enabled on tower-grpc-build crate, the client code is still not usable since impl client::Encodable<tower_hyper::Body> is missing, cf.

impl<T, U> Encodable<BoxBody> for T

@dingxiangfei2009
Copy link
Author

dingxiangfei2009 commented Aug 7, 2019

Currently, the workaround is by wrapping the service from tower_hyper and inside impl Service using BoxBody::map_from for fn call.

@LucioFranco
Copy link
Member

The codegen currently does this for the server here https://github.com/tower-rs/tower-grpc/blob/master/tower-grpc-build/src/server.rs#L313

What is your use case for the client side? iirc you shouldn't have to worry about this when generating codegen since the client will just use BoxBody.

@dingxiangfei2009
Copy link
Author

dingxiangfei2009 commented Aug 8, 2019

Currently I am trying to use tokio::net::UnixStream as the transport. It is first wrapped into a hyper client by impl hyper::client::connect::Connect, and lifted into a tokio_hyper client. Note that a tokio_hyper client always uses hyper::Body instead of the designated body type, according to its impl Service.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants