You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 16, 2020. It is now read-only.
Noticed this while working on #3 (gRPC interop test cases). When a .proto file defines multiple services, tower-grpc-build will generate a separate pub mod server and pub mod client for each service in the generated code's root module. Needless to say, the Rust compiler doesn't like this.
Compiling tower-grpc-examples v0.1.0(file:///Users/eliza/Code/tower-grpc/tower-grpc-examples)
error[E0428]: the name `client` is defined multiple times
--> /Users/eliza/Code/tower-grpc/target/debug/build/tower-grpc-examples-e932e45db921086e/out/helloworld.rs:232:1
|
14 | / pub mod client {15 | | use ::tower_grpc::codegen::client::*;16 | | use super::{HelloRequest, HelloReply};17 | |
... |
44 | | }45 | | }
| |_- previous definition of the module `client` here
...
232 | / pub mod client {233 | | use ::tower_grpc::codegen::client::*;234 | | use super::{HelloRequest, HelloReply};235 | |
... |
262 | | }263 | | }
| |_^ `client` redefined here
|
= note: `client` must be defined only once in the type namespace of this module
error[E0428]: the name `server` is defined multiple times
--> /Users/eliza/Code/tower-grpc/target/debug/build/tower-grpc-examples-e932e45db921086e/out/helloworld.rs:265:1
|
47 | / pub mod server {48 | | use ::tower_grpc::codegen::server::*;49 | | use super::{HelloRequest, HelloReply};50 | |
... |
229 | | }230 | | }
| |_- previous definition of the module `server` here
...
265 | / pub mod server {266 | | use ::tower_grpc::codegen::server::*;267 | | use super::{HelloRequest, HelloReply};268 | |
... |
447 | | }448 | | }
| |_^ `server` redefined here
|
= note: `server` must be defined only once in the type namespace of this module
error: aborting due to 2 previous errors
The text was updated successfully, but these errors were encountered:
Of course, generating server code from protos with multiple services won't really work until #2 is done, since we can only serve one service per socket address, but it seems like we should be able to at least generate that compiles --- we might want to generate client code from a proto with multiple services, or have a server select which service to serve?
Noticed this while working on #3 (gRPC interop test cases). When a
.proto
file defines multiple services,tower-grpc-build
will generate a separatepub mod server
andpub mod client
for each service in the generated code's root module. Needless to say, the Rust compiler doesn't like this.Failing example (I modified
helloworld.proto
):and compiler errors:
The text was updated successfully, but these errors were encountered: