Idiomatic import paths
- Dominant language
- Rust
- Stars
- 12.5k
- Forks
- 1.3k
- Avg merge
- 4d 7h
- Merged PRs (30d)
- 24
Description
## Feature Request
### Crates
`tonic_build`
### Proposal
For every `service ServiceName` definition, we add
```
pub mod service_name {
pub use super::{
service_name_client::ServiceNameClient,
service_name_server::{ServiceName, ServiceNameServer},
};
}
pub use service_name::ServiceName;
```
#### Pros
- Simpler, cleaner imports
- Naming follows `prost`. E.g. nested messages.
#### Cons
- Users need to use different imports (or we can just alias these and not make a breaking change)
### Motivation
Currently, we separate the client and server in two distinct modules which is not as idiomatic as just have one module that exports the client and server exports. For precedent, see [`std::path::Path`](https://doc.rust-lang.org/std/path/struct.Path.html).
### Alternatives
One can manually add these aliases.
Contributor guide
Assessment
This issue has not been assessed yet.