#protoc #protoc-gen-rust #path #grpc #protobuf #api #generate

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

#4 in #protoc-gen-rust

Download history 46/week @ 2024-11-16 86/week @ 2024-11-23 92/week @ 2024-11-30 256/week @ 2024-12-07 225/week @ 2024-12-14 23/week @ 2024-12-21 10/week @ 2024-12-28 100/week @ 2025-01-04 232/week @ 2025-01-11 167/week @ 2025-01-18 100/week @ 2025-01-25 240/week @ 2025-02-01 242/week @ 2025-02-08 197/week @ 2025-02-15 227/week @ 2025-02-22 89/week @ 2025-03-01

805 downloads per month
Used in fewer than 12 crates

MIT/Apache

36KB
658 lines

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

~4–13MB
~178K SLoC