[][src]Crate pb_jelly_gen

pb_gen generates Rust bindings for proto2 and proto3 files. It's intended to be used with pb_rs.


Complete examples can be found in the examples crate, or the pb-test crate of the protobuf_rs workspace.

In a nutshell 🥜

You can include pb_gen in your Cargo project, by including it as a [build-dependency] in your Cargo.toml

pb-gen = "0.1"

Then from a build.rs script, use either the GenProtos builder struct, or the gen_protos convience function to specify where your protos live, and where the generated code should be put.

use pb_gen::GenProtos;
fn main() -> std::io::Result<()> {
       // output path for our generated code
       // directory where our protos live
       // delete and recreate the `out_path` directory every time




A builder struct to configure the way your protos are generated, create one with GenProtos::builder()



A "no frills" way to generate Rust bindings for your proto files. src_paths is a list of paths to your .proto files, or the directories that contain them. Generated code it outputted to <current crate's manifest>/gen.