Feature Request
Crates
grpc-protobuf-build
protoc-gen-rust-grpc
Motivation
In the past prost-build and tonic-build were structuring generated code in the same shape as packages in .proto files were structured. That was good. The same scoping in .proto files and Rust code ensured that there's no name conflicts in Rust code as long as there's no name conflicts in .proto files and that module structure is convenient in Rust code as long as it's convenient in .proto files. Sometimes it was slightly too verbose for a reason, but it's easy to create a convenient alias for a module with too long name.
Now grpc-protobuf-build structure generated code in a file-based tree and merge everything together with a lot of use module_name::*. This is not good. It creates name conflicts and completely melts away the package-based namespacing defined in .proto files. This can be overcome by manually compiling each file into its own module, then manually configuring dependencies between them, then manually generating a root module that structures generated modules into expected shape, which is extremely hard and inconvenient.
Proposal
I suggest to add a feature (and probably make it default) for generating Rust code in modules structured the same way as packages in .proto files are structured.
Feature Request
Crates
grpc-protobuf-buildprotoc-gen-rust-grpcMotivation
In the past
prost-buildandtonic-buildwere structuring generated code in the same shape as packages in.protofiles were structured. That was good. The same scoping in.protofiles and Rust code ensured that there's no name conflicts in Rust code as long as there's no name conflicts in.protofiles and that module structure is convenient in Rust code as long as it's convenient in.protofiles. Sometimes it was slightly too verbose for a reason, but it's easy to create a convenient alias for a module with too long name.Now
grpc-protobuf-buildstructure generated code in a file-based tree and merge everything together with a lot ofuse module_name::*. This is not good. It creates name conflicts and completely melts away the package-based namespacing defined in.protofiles. This can be overcome by manually compiling each file into its own module, then manually configuring dependencies between them, then manually generating a root module that structures generated modules into expected shape, which is extremely hard and inconvenient.Proposal
I suggest to add a feature (and probably make it default) for generating Rust code in modules structured the same way as packages in
.protofiles are structured.