Skip to content

Conversation

koesie10
Copy link
Contributor

Motivation

Tonic v0.13 had a service_generator method on tonic_build::Builder, which allowed retrieving the prost_build::ServiceGenerator implementation for more advanced customization. This method was removed in v0.14, but would still be useful to have in tonic_prost_build.

Solution

This adds back the service_generator method to tonic_prost_build::Builder. The previous implementation of service_generator is here.

I've also removed the out_dir field from the Builder struct since this was not used and would require the service_generator method definition to differ from v0.13.

I've duplicated the ServiceGenerator::new call since this was already duplicated between compile_with_config and compile_fds_with_config. Instead of duplicating the ServiceGenerator::new call, should I change the other calls from ServiceGenerator::new to self.service_generator()?

This adds back the `service_generator` method to the
`tonic_prost_build::Builder`, which allows retrieving the
`prost_build::ServiceGenerator` implementation. This was present in
Tonic v0.13, so this just adds back the method.
@LucioFranco LucioFranco merged commit bfe2b07 into hyperium:master Aug 1, 2025
20 checks passed
cjqzhao pushed a commit to cjqzhao/tonic that referenced this pull request Aug 7, 2025
cjqzhao pushed a commit to cjqzhao/tonic that referenced this pull request Aug 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants