#grpc #google #protocol-buffers #path #api #protocol #buffers

protoc-rust-grpc

protoc –rust-grpc_out=… available as API. protoc needs to be in $PATH, protoc-gen-rust-grpc does not.

10 releases (5 breaking)

0.6.2 Jan 14, 2020
0.6.1 Nov 8, 2018
0.6.0 Oct 16, 2018
0.5.0 Jun 16, 2018
0.2.1 Jul 10, 2017
Download history 474/week @ 2019-11-23 600/week @ 2019-11-30 592/week @ 2019-12-07 604/week @ 2019-12-14 188/week @ 2019-12-21 320/week @ 2019-12-28 431/week @ 2020-01-04 516/week @ 2020-01-11 607/week @ 2020-01-18 566/week @ 2020-01-25 335/week @ 2020-02-01 265/week @ 2020-02-08 343/week @ 2020-02-15 389/week @ 2020-02-22 287/week @ 2020-02-29 405/week @ 2020-03-07

2,255 downloads per month
Used in 15 crates (10 directly)

MIT/Apache

1MB
24K SLoC

API to generate .rs files

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

Example code:

extern crate protoc_rust_grpc;

fn main() {
    protoc_rust_grpc::run(protoc_rust_grpc::Args {
        out_dir: "src",
        includes: &["proto"],
        input: &["proto/aaa.proto", "proto/bbb.proto"],
        rust_protobuf: true, // also generate protobuf messages, not just services
        ..Default::default()
    }).expect("protoc-rust-grpc");
}

Note this API requires protoc command present in $PATH. Although protoc-gen-rust-grpc command is not needed.

Dependencies

~1MB
~15K SLoC