tikv / grpc-rs

The gRPC library for Rust built on C Core library and futures
Apache License 2.0
1.81k stars 253 forks source link

Publicize prost service generator #612

Closed nick-mobilecoin closed 1 year ago

nick-mobilecoin commented 1 year ago

Make the prost service generator available to clients. This allows clients to customize how the underlying prost build is invoked.

Signed-off-by: Nick Santana nick@mobilecoin.com


name: Publicize Prost Service Generator about: Makes the prost generator a public struct


Description of feature: The prost service generator is now public, allowing clients finer grain control on the prost build behavior.

Implementation: The initial desire for this was to allow us to build just the services, while re-using the messages. The current grpcio_compiler::prost_codegen::compile_protos() function would either fail to build when local protos were excluded from the include path, or generate the local proto messages to the generated services. Making the Generator public seemed like the best way to meet this current need and also allow future customers to customize the prost build behavior while still generating the grpcio services.

Expanding the availability of the Generator looks to be limited to making the ServiceGenerator trait methods also available. It doesn't seem to be exposing anything else from the internals.

Checklist:

The CI will check all of these, but you'll need to have done them: