-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Description
Bug Report
Version
0.6.2
Platform
any
Crates
tonic
Description
The type signatures in the Server/Router builders are convoluted and reference private types, which makes them completely un-understandable to users.
For example, from tonic::transport::server::Router:
pub async fn serve<ResBody>(self, addr: SocketAddr) -> Result<(), Error> where
L: Layer<Routes<A, B, Request<Body>>>,
L::Service: Service<Request<Body>, Response = Response<ResBody>> + Clone + Send + 'static,
<<L as Layer<Routes<A, B, Request<Body>>>>::Service as Service<Request<Body>>>::Future: Send + 'static,
<<L as Layer<Routes<A, B, Request<Body>>>>::Service as Service<Request<Body>>>::Error: Into<Box<dyn Error + Send + Sync>> + Send,
ResBody: Body<Data = Bytes> + Send + 'static,
ResBody::Error: Into<Box<dyn Error + Send + Sync>>, Besides this just being an incredibly complex type signature, users can't derive any information out of it because the type Routes is private. In particular, you can't figure out what the associated types mean (or what the constraints imply) without going to the source code.
Metadata
Metadata
Assignees
Labels
No labels