• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

src/H03-May-2022-3,8553,067

.cargo-checksum.jsonH A D03-May-202289 11

.cargo_vcs_info.jsonH A D11-Apr-202074 65

Cargo.lockH A D11-Apr-2020632 2522

Cargo.tomlH A D11-Apr-20201.2 KiB3732

Cargo.toml.orig-cargoH A D11-Apr-2020727 3023

README.mdH A D11-Apr-2020813 3123

README.md

1# API to generate .rs files
2
3API to generate `.rs` files to be used e. g. [from build.rs](https://github.com/stepancheg/rust-protobuf/blob/master/protobuf-codegen-pure-test/build.rs).
4
5Example code:
6
7```
8extern crate protobuf_codegen_pure;
9
10protobuf_codegen_pure::run(protobuf_codegen_pure::Args {
11    out_dir: "src/protos",
12    input: &["protos/a.proto", "protos/b.proto"],
13    includes: &["protos"],
14    customize: Customize {
15      ..Default::default()
16    },
17}).expect("protoc");
18```
19
20And in `Cargo.toml`:
21
22```
23[build-dependencies]
24protobuf_codegen_pure = "1.5"
25```
26
27The alternative is to use
28[protoc-rust crate](https://github.com/stepancheg/rust-protobuf/tree/master/protoc-rust),
29which relies on `protoc` command to parse descriptors (thus it's more reliable),
30but it requires `protoc` command in `$PATH`.
31