Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | 03-May-2022 | - | ||||
src/ | H | 03-May-2022 | - | 3,855 | 3,067 | |
.cargo-checksum.json | H A D | 03-May-2022 | 89 | 1 | 1 | |
.cargo_vcs_info.json | H A D | 11-Apr-2020 | 74 | 6 | 5 | |
Cargo.lock | H A D | 11-Apr-2020 | 632 | 25 | 22 | |
Cargo.toml | H A D | 11-Apr-2020 | 1.2 KiB | 37 | 32 | |
Cargo.toml.orig-cargo | H A D | 11-Apr-2020 | 727 | 30 | 23 | |
README.md | H A D | 11-Apr-2020 | 813 | 31 | 23 |
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