Skip to content
Branch: master
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
src Treat paths as impl AsRef<Path> Apr 15, 2019

API to generate .rs files

API to generate .rs files to be used e. g. from

Example code:

With stable rust-protobuf:

extern crate protobuf_codegen_pure;

protobuf_codegen_pure::run(protobuf_codegen_pure::Args {
    out_dir: "src/protos",
    input: &["protos/a.proto", "protos/b.proto"],
    includes: &["protos"],
    customize: protobuf_codegen_pure::Customize {

With rust-protobuf from master:

extern crate protobuf_codegen_pure;

    .inputs(&["protos/a.proto", "protos/b.proto"])

And in Cargo.toml:

protobuf-codegen-pure = "2.3"

The alternative is to use protoc-rust crate, which relies on protoc command to parse descriptors. Both crates should produce the same result, otherwise please file a bug report.

You can’t perform that action at this time.