Open mkatychev opened 2 months ago
+1 to this! It would make it a lot less verbose to get the service name.
I cannot seem to reproduce this diff locally with protobuf 25: https://github.com/hyperium/tonic/actions/runs/9472891207/job/26134316596#step:7:16
@mkatychev you just need to run cargo run --package codegen
@mkatychev you just need to run
cargo run --package codegen
Hi @LucioFranco I did that with the given version of protoc (25.1) on macOS and I am not able to produce the comment diff in the run log
@mkatychev you just need to run
cargo run --package codegen
Hi @LucioFranco I did that with the given version of protoc (25.1) on macOS and I am not able to produce the comment diff in the run log
Run cargo update
locally before you run the codegen?
Motivation
It is oftentimes cumbersome to use
tonic::server::NamedService::NAME
whenT
has multiple generics:This is particularly egregious when using the
HealthReporter
methods sinceHealthReporter::set_serving
requires a fully qualifiedServiceServer<T>
:Solution
expose a
pub const fn service_name() -> &'static str
that returns the formatted string.