Library / SDK
tikv/grpc-rs avatar
tikv/grpc-rs

gRPC-rs for Rust: Setup, Codecs, TLS, and Constraints

The gRPC library for Rust built on C Core library and futures

1,848 stars259 forksRustApache-2.0

At a glance

What is it?
gRPC-rs wraps gRPC Core for Rust and exposes asynchronous calls through Rust futures and Protobuf codecs. It fits applications needing native gRPC interoperability, but its build requirements and unfinished server load reporting narrow adoption.
Who is it for?
Adopt gRPC-rs when the application needs Rust futures, gRPC Core interoperability, and either Protobuf or prost serialization. Do not choose it when its native build prerequisites are unsuitable or server-side load reporting is mandatory.
Can I use it commercially?
Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 4 days ago.
What is it written in?
Mainly Rust, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on October 23, 2026, and from our analysis. They are not legal advice.

Editorial analysis

Why gRPC-rs Wraps gRPC Core

gRPC-rs solves the problem of using the established gRPC Core implementation from Rust without requiring the networking runtime and wire behavior to be reimplemented as a separate Rust stack. It is aimed at developers building asynchronous Rust services or clients that need gRPC and HTTP/2 interoperability. The README describes the project as a Rust wrapper of gRPC Core, and the package metadata identifies asynchronous network programming as a primary category.

The library is not limited to ordinary request and response calls. Its documented feature list includes asynchronous unary and streaming calls, generic calls, health checks, authentication, SSL, and connection-level compression. This makes it relevant when a service needs more than a simple unary wrapper, such as health reporting or generic gRPC operations. The repository also contains health, interoperability, benchmark, compiler, and test or example workspaces, which shows that these concerns are represented as repository components rather than described only as future ideas.

Several entries in the support matrix remain incomplete. Custom metadata and reflection are marked unsupported, while server-side load reporting is not implemented even though client-side load balancing is marked as supported. That support profile should shape adoption decisions. A team whose protocol depends on server reflection during development or requires custom metadata cannot treat those missing functions as available features of version 0.13.0.

The gRPC Core, Futures, and Codec Data Path

The architecture has two distinct layers. `grpcio` provides the Rust-facing API and depends on `grpcio-sys`, which represents the native gRPC Core component. Rust asynchronous primitives come from `futures-executor` and `futures-util`. The `futures-util` dependency enables the `std` and `sink` features, which is consistent with an API that handles streams and asynchronous gRPC operations.

Message serialization is selected through Cargo features rather than fixed by the wrapper. The default feature set is `protobuf-codec` plus `boringssl`. A `protobuf-codec` feature enables the optional `protobuf` dependency, while `prost-codec` enables `prost` and `bytes`. The manifest also defines `protobufv3-codec`, tied to the optional `protobufv3` package entry, and states that projects should normally enable only one codec. The README warns that `grpcio-compiler` does not work as expected when both the `protobuf-codec` and `prost-codec` features are enabled, even though the library can accept both.

This design keeps the protocol implementation native while allowing the Rust application to choose its message representation. It also introduces a build and linking surface that a pure-Rust client library would not have. Depending on `grpcio-sys` means toolchain, platform, and TLS configuration must be considered during dependency resolution.

Prerequisites Before Building gRPC-rs

A fresh source checkout requires more preparation than an ordinary Cargo-only crate. The documented prerequisites are CMake 3.8.0 or newer, Rust 1.36.0 or newer, binutils 2.22 or newer, and LLVM with Clang 3.9 or newer when bindings must be generated during compilation. Linux and macOS also require gcc 7.3 or newer, or clang 6 or newer.

Bindings are pre-generated for x86_64 and arm64 Linux. Other platforms generate them at compile time, so those platforms inherit the LLVM and Clang requirement. Windows has a separate toolchain list: Active State Perl, yasm, and Visual Studio 2015 or newer. The README does not provide substitute commands or explain whether every prerequisite is mandatory for every feature.

After installing those tools, a clone needs its submodule content prepared. The following command is reserved for a newly cloned repository and initializes the submodules through the project's `xtask` extension. Omitting it can leave the vendored native source unavailable. The repository workspace also includes `grpc-sys/grpc`, confirming that the build depends on more than the small set of Rust source files under `src/`.

Building the Workspace and Adding grpcio

The documented first build has two steps. The first command prepares submodules only when the repository was just cloned. The second asks Cargo to build the project using the tools established in the preceding section.

bash
$ cargo xtask submodule
$ cargo build

A consuming Rust application does not need to copy those commands into its own build process. It declares `grpcio` through Cargo.toml. Version 0.13 corresponds to the most recent listed release, v0.13.0.

toml
[dependencies]
grpcio = "0.13"

The dependency brings the default `protobuf-codec` and `boringssl` features. Applications that do not require TLS can avoid that default by disabling default features and requesting only `protobuf-codec`. The README gives this configuration for intranet workloads:

toml
[dependencies]
grpcio = { version = "0.13", default-features = false, features = ["protobuf-codec"] }

This choice affects native dependencies and symbol exposure. It should be made deliberately rather than copied without checking whether the application later adds TLS or OpenSSL.

Generating Rust Bindings from a Proto File

For a first real use, a `.proto` definition must be converted into Rust sources and a gRPC plugin implementation. The README presents manual generation and programmatic generation as alternatives. Manual generation is fully documented; programmatic generation delegates details to the `protoc-grpcio` documentation.

For manual generation, install the two Rust code generators named by the project. These commands install `protobuf-codegen` and `grpcio-compiler` from Cargo.

bash
$ cargo install protobuf-codegen
$ cargo install grpcio-compiler

Then invoke `protoc` with Rust output and gRPC output. The exact README command uses `example.proto`, writes both outputs into the current directory, and locates `grpc_rust_plugin` through `which` inside the command substitution.

bash
$ protoc --rust_out=. --grpc_out=. --plugin=protoc-gen-grpc=`which grpc_rust_plugin` example.proto

The guide assumes that the protobuf compiler is installed, although it does not provide an installation command for `protoc` itself. The generated output also depends on codec selection: using prost is not equivalent to using the default Protobuf implementation. The compiler warning about both codecs being enabled means this step should be performed in a dependency configuration with exactly the intended codec enabled.

BoringSSL, OpenSSL, and Linking Conflicts

gRPC Core is bundled in gRPC-rs and defaults to BoringSSL through the `boringssl` feature. The README warns that this can produce symbol clashes or missing symbols when another dependency uses OpenSSL. The documented resolution is to select the `openssl` feature, which requires OpenSSL 1.0.2 or newer.

toml
[dependencies]
grpcio = { version = "0.13", features = ["openssl"] }

There is also an `openssl-vendored` feature. According to the README, it behaves like `openssl` but builds OpenSSL from bundled sources. That distinction matters during deployment because a system OpenSSL installation and a vendored source build have different setup requirements, even though both expose the same feature choice to the application.

SSL is part of the supported feature list, but the documentation does not provide a complete certificate, hostname, or server configuration tutorial. Authentication is marked supported, yet it should not be confused with the unfinished custom metadata and reflection entries. An adoption review needs to inspect the actual application protocol and the relevant project documentation rather than treating every gRPC capability as available by association.

Maintenance Signals and Upgrade Boundaries

The repository is not archived, and its last push was on 2026-09-14. The README nevertheless says, "This project is still under development." Its recent release history is older: v0.13.0 was released on 2023-10-07, followed by v0.11.0 and v0.12.0 in 2022. A recent repository change therefore does not by itself establish that a new Cargo release has captured current `master` behavior.

Upgrades involve more than changing a Rust dependency version. The native gRPC Core source lives under `grpc-sys/grpc`. If that content changes, the README gives a binding regeneration command.

bash
$ cargo xtask bindgen

It also lists LLVM, Clang, CMake, binutils, and platform compilers as relevant build components. Codec changes can affect the compiler, since `grpcio-compiler` is patched from the local `compiler` workspace. TLS changes can alter native linking requirements. These are the main upgrade costs documented by the project.

The package is licensed under Apache-2.0, as shown in both the README metadata and `Cargo.toml`. That identifies the repository's declared license, but it does not by itself answer questions about bundled third-party components, local modifications, or distribution obligations. License review should cover the actual dependency tree and native sources used by the selected build.

When gRPC-rs Is the Wrong Choice

The clearest wrong-tool case is a project that cannot accept a native gRPC Core build. The prerequisite list spans several compilers and platform tools, bindings are generated at compile time outside pre-generated x86_64 and arm64 Linux targets, and OpenSSL may need to be aligned with the rest of the dependency graph. A pure-Rust-only toolchain policy would conflict with the documented architecture.

Feature requirements can rule it out as well. Server-side load reporting is absent, custom metadata is unchecked, and reflection is unchecked in the README's support matrix. A service designed around those capabilities needs either a different design or another implementation.

The codec choice also creates a boundary. Manual generation through `grpcio-compiler` is documented, but enabling both `protobuf-codec` and `prost-codec` breaks the compiler's expected behavior according to the README. An organization already committed to prost should configure only `prost-codec` and verify its generated code path. Organizations choosing the default should account for the older protobuf 2.0 dependency declared in `Cargo.toml` and the separate optional protobuf 3.2 package entry.

Editorial conclusion

Adopt gRPC-rs when the application needs Rust futures, gRPC Core interoperability, and either Protobuf or prost serialization. Do not choose it when its native build prerequisites are unsuitable or server-side load reporting is mandatory. Verify codec selection, TLS integration, required bindings, and the documented feature gaps first. The latest listed release is v0.13.0 from 2023-10-07, while the last push was on 2026-09-14.

Frequently asked questions

How do I install and build gRPC-rs?

Install the documented CMake, Rust, binutils, compiler, and platform prerequisites first. For a fresh clone, run `cargo xtask submodule`, then run `cargo build`.

Which Protobuf codec should gRPC-rs use?

gRPC-rs uses the `protobuf` crate by default. A project can select `prost-codec` instead, but the README advises enabling only one codec because `grpcio-compiler` may not work as expected when both are enabled.

How does gRPC-rs handle OpenSSL linking conflicts?

Because bundled gRPC Core defaults to BoringSSL, conflicts can occur when another dependency uses OpenSSL. The documented workaround is to enable the `openssl` feature, which requires OpenSSL 1.0.2 or newer.

Official sources

  1. Issues
  2. License: Apache-2.0
  3. README
  4. Releases
  5. tikv/grpc-rs on GitHub
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/tikv-grpc-rs.svg)](https://hysenlabs.com/projects/tikv-grpc-rs)

Was this useful?