You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello.
I am writing a wrapper library for a networking protocol that uses protobuf.
Among the wrapping I do, I want to make the interface backend-agnostic, and add IDs automatically attributed to all message types.
However, I find the task unnecessary difficult: adding the automated IDs requires me to parse prost_build's output, and juggle with modules.
The task would be much easier if prost_build::compile_protos returned information on what it built, most notably the message's names, as with that it is easy to generate code that will implement a custom trait on those structs.
The text was updated successfully, but these errors were encountered:
That being said, I think a better solution to this is not to add hooks deep into prost code generation, but instead see if you could solve it by creating your own custom derive implementation and annotating the prost generated messages with a derive annotation via type_attribute. This has the considerable upside that you can annotate any struct, not just prost-generated types.
Hello.
I am writing a wrapper library for a networking protocol that uses protobuf.
Among the wrapping I do, I want to make the interface backend-agnostic, and add IDs automatically attributed to all message types.
However, I find the task unnecessary difficult: adding the automated IDs requires me to parse
prost_build
's output, and juggle with modules.The task would be much easier if
prost_build::compile_protos
returned information on what it built, most notably the message's names, as with that it is easy to generate code that will implement a custom trait on those structs.The text was updated successfully, but these errors were encountered: