#protobuf #service #expect

build protoc-rust-grpc

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

16 releases

0.8.3 Mar 28, 2021
0.8.2 Sep 20, 2020
0.8.1 May 25, 2020
0.6.2 Jan 14, 2020
0.2.1 Jul 10, 2017

#32 in #expect

Download history 118/week @ 2024-12-04 328/week @ 2024-12-11 97/week @ 2024-12-18 2/week @ 2024-12-25 68/week @ 2025-01-01 123/week @ 2025-01-08 221/week @ 2025-01-15 141/week @ 2025-01-22 169/week @ 2025-01-29 265/week @ 2025-02-05 251/week @ 2025-02-12 166/week @ 2025-02-19 196/week @ 2025-02-26 69/week @ 2025-03-05 261/week @ 2025-03-12 103/week @ 2025-03-19

649 downloads per month
Used in fewer than 12 crates

MIT/Apache

1.5MB
32K SLoC

C 26K SLoC // 0.1% comments Rust 6K SLoC // 0.1% comments Bitbake 794 SLoC // 0.2% comments Bazel 57 SLoC // 0.1% comments Shell 8 SLoC

API to generate .rs files

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

Example code:

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.


lib.rs:

API to generate .rs files.

Dependencies

~3–12MB
~149K SLoC