Crate protoc_rust_copra [−] [src]
Code generator for copra RPC framework
This crate provides one function run
, which can generate service provider
templates and client side stubs from .proto
files. The best place to use
this function is the build.rs
file. For more information about build.rs
,
please refer to the build scripts section of the official cargo book.
Examples
Say, we have a awesome.proto
file in the project root directory (i.e. next
to Cargo.toml
), and we want to generate rust code in src/generated
.
We can add this to build.rs
:
extern crate protoc_rust_copra; fn main() { protoc_rust_copra::run(protoc_rust_copra::Args { out_dir: "src/generated", input: &["awesome.proto"], includes: &[], rust_protobuf: true }).expect("Failed to compile proto files"); }
Acknowledgment
The crate is a mirror of protoc-rust-grpc.
Structs
Args |
Argument passed to |
Functions
run |
Generate rust code |