prost
prost copied to clipboard
README says prost generates module hierarchy following package keyword
README file is misleading regarding prost generating modules following the package
keyword. It says "All Rust types generated from the file will be in the foo::bar
module." but as far as I can see using the example found here: https://github.com/danburkert/snazzy this is not the case.
Instead it is up to the user to work with mod
and include!
and recreate the modules hierarchy following the package
value.
Am I correct or is there another way to do it ?
I guess the include_file()
method from prost_build::Config
is implementing the expected behaviour.
https://docs.rs/prost-build/latest/prost_build/struct.Config.html#method.include_file
docs.rs/prost-build/latest/prost_build/struct.Config.html#method.include_file
oh, this solution works for me too, thank you!
prost's authors should definitely mark it somewhere in README
That's also what I was looking for.
A good thing that it is already available, but as beautyfree said:
- it should be described on the main documentation page,
- I would even recommend to generate the file by default with name 'mod.rs' (that's what protobuf seems to do).