Build-time integration for connectrpc.
Use this crate in build.rs to compile .proto files into Rust code at
build time. It shells out to protoc (or buf, or reads a precompiled
FileDescriptorSet) to obtain descriptors, then runs
[connectrpc_codegen] to emit buffa message types plus ConnectRPC
service traits and clients into $OUT_DIR. Comments in the .proto
source are carried into the generated Rust as doc comments, as long as
the descriptors carry source info — the protoc and buf sources always
do, but a precompiled set must be built with it (see
[Config::descriptor_set]).
Example
// build.rs
// lib.rs
include_generated!;
Requirements
Requires protoc on PATH (or set via PROTOC). To use buf instead,
call [Config::use_buf]. To avoid both, precompile a FileDescriptorSet
once and ship it alongside your source via [Config::descriptor_set].
To embed the compiled FileDescriptorSet in your binary — for example
to back gRPC server reflection — see [Config::emit_descriptor_set].