Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add example for rust-protobuf codec #1789

Closed
wants to merge 1 commit into from
Closed

add example for rust-protobuf codec #1789

wants to merge 1 commit into from

Conversation

0xcaff
Copy link

@0xcaff 0xcaff commented Jul 11, 2024

Motivation

I've found the rust-protobuf crate to have some features which prost doesn't have (namely retaining unknown fields). I want to use tonic (codegen and all) with rust-protobuf as seamlessly as with prost.

Solution

This is an example of how I setup codgen and a codec to work as a drop in replacement for prost.

Looking for feedback

I'm looking for feedback about whether there's a better home for this glue to live. Should this be a first party feature in tonic instead of something in the examples folder? I considered putting it in its own crate but it didn't seem to generalize well. Should it go in rust-protobuf?

@djc
Copy link
Contributor

djc commented Jul 13, 2024

I've found the rust-protobuf crate to have some features which prost doesn't have (namely retaining unknown fields).

Have you proposed this feature for implementation in prost? That seems like a simpler way forward.

Personally I'm not sure I'm motivated enough to review this code for inclusion in this repository (but other maintainers may have a different opinion).

@0xcaff
Copy link
Author

0xcaff commented Jul 13, 2024

I've found the rust-protobuf crate to have some features which prost doesn't have (namely retaining unknown fields).

Have you proposed this feature for implementation in prost? That seems like a simpler way forward.

Personally I'm not sure I'm motivated enough to review this code for inclusion in this repository (but other maintainers may have a different opinion).

The scope of adding unknown field support to prost is quite large. tokio-rs/prost#2 There's a big gap between proposing a feature in prost and having something which works today. Additionally I believe the design choices made by rust-protobuf vary quite a bit from prost and make sense for a lot of folks (look at the crate stats, I'm not the only user of rust-protobuf).

I understand that its not a priority. I will invest my effort elsewhere.

@0xcaff 0xcaff closed this Jul 13, 2024
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