Open kriswuollett opened 11 months ago
I have a similar use-case. I was able to look at some of the code you started on and created a fully working example: https://github.com/dfrankland/tonic-no-codegen-example
I have a similar use case too. I got it working with tonic (codgen and all) here. https://github.com/hyperium/tonic/pull/1789
I'd like to make use of
rust-protobuf
instead ofprost
when building servers based ontonic
. Primary use cases are reading options on messages and service descriptors, and being able to use the semi-official proto3 JSON standard for setting up test cases and config files.I assume something like this would be widely used since
rust-protobuf
has more proto features that may be needed without relying on additional third party libraries likeprost-reflect
(and would that even work withtonic-build
?). And maybe if Rust consolidated on a single maintained proto library, there may be more users willing to contribute. The big unknown factor however is if Google ever decides to release their own instead of anointing an existing proto library -- then why take time to contribute at all if everything else gets dropped in the near future? Thankfullyrust-protobuf
andgrpc-rs
are mentioned by Google on an Android page, but nogrpc-rs
for me currently since I'd like to work withintower
.So
tonic
seems implemented fairly flexibly since it based ontower
(see theService
re-export) and thattonic::Codec
exists as a translator:That is used by the
tower
-based gRPC service to decode a message in the stream.Isn't using using
rust-protobuf
withtonic
(just 😅) the following steps?Codec
here liketonic::codec::prost::ProstCodec
tonic-build
I'm assuming it is straightforward due to the
Codec
trait, so kind of surprised I couldn't find an implementation in an internet search forrust-protobuf tonic codec
. No one has looked into trying this before?