API to generate .rs
files to be used e. g. from build.rs.
Example code:
```rust use ttrpccodegen::Codegen; use ttrpccodegen::Customize;
fn main() { Codegen::new() .outdir("protocols/sync") .inputs(&protos) .include("protocols/protos") .rustprotobuf() .customize(Customize { ..Default::default() }) .run() .expect("Gen code failed."); }
```
And in Cargo.toml
:
[build-dependencies]
ttrpc-codegen = "0.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.