Config option to use proto `enum`s as Rust `enum`s
By default, protos enums are converted to Rust i32. Which can be annoying / not convenient.
I created a new Config field - proto_enum_to_rust_enum - that, when activated, converts proto's enums into Rust's enum instead of i32,
The data transferred over the wire is exactly the same as i32. (See: prost-derive/src/field/enum_typed.rs)
Not sure where to put the test in prost-build/src/code_generator.rs?
This might be a partial fix to https://github.com/tokio-rs/prost/issues/276 btw
Related PR: #1079
Yes! But this one is really easy to implement since it keeps the same declaration of enums, it's just that the types used in messages (in the Rust representation) are enums.
I think that it could be a nice addition, even to #1079 in case you don't want to handle open enums.
Also, would be really easy to add support for Result<_, i32> https://github.com/tokio-rs/prost/pull/1079#issuecomment-2197525664