登录 注册

grpc-rust

去点 Star
开发者工具 asyncgrpcprotorpcrust
12,549
Stars
1,282
Forks
72
Watchers
346
Open Issues
MIT
许可证
Rust
语言
2019-08-09
创建时间
2026-11-12
最近更新

项目能做什么

支持 async/await 的原生 Rust gRPC 客户端与服务端实现。
来源:AI 基于仓库事实生成 · 内容以仓库实际 README 为准

使用说明 查看原始 README 原仓库文档

中文使用说明暂未生成。下面保留原仓库 README 摘录,命令与配置均以原文为准。
原始 README 摘录(英文原文,节选前 3000 字符)
![](https://github.com/grpc/grpc-rust/raw/master/.github/assets/tonic-banner.svg?sanitize=true)


A rust implementation of [gRPC], a high performance, open source, general
RPC framework that puts mobile and HTTP/2 first.

> **Note**: tonic's [master](https://github.com/grpc/grpc-rust) branch is
> currently preparing breaking changes. For the most recently *released* code,
> look to the [0.14.x branch](https://github.com/grpc/grpc-rust/tree/v0.14.x).

[`tonic`] is a gRPC over HTTP/2 implementation focused on high performance, interoperability, and flexibility. This library was created to have first class support of async/await and to act as a core building block for production systems written in Rust.

[![Crates.io](https://img.shields.io/crates/v/tonic)](https://crates.io/crates/tonic)
[![Documentation](https://docs.rs/tonic/badge.svg)](https://docs.rs/tonic)
[![Crates.io](https://img.shields.io/crates/l/tonic)](LICENSE)


[Examples] | [Website] | [Docs] | [Chat][discord]

## Overview

[`tonic`] is composed of three main components: the generic gRPC implementation, the high performance HTTP/2
implementation and the codegen powered by [`prost`]. The generic implementation can support any HTTP/2
implementation and any encoding via a set of generic traits. The HTTP/2 implementation is based on [`hyper`],
a fast HTTP/1.1 and HTTP/2 client and server built on top of the robust [`tokio`] stack. The codegen
contains the tools to build clients and servers from [`protobuf`] definitions.

## Features

- Bi-directional streaming
- High performance async io
- Interoperability
- TLS backed by [`rustls`]
- Load balancing
- Custom metadata
- Authentication
- Health Checking

## Getting Started

- The [`helloworld`][helloworld-tutorial] tutorial provides a basic example of using `tonic`, perfect for first time users!
- The [`routeguide`][routeguide-tutorial] tutorial provides a complete example of using `tonic` and all its features.

Examples can be found in [`examples`] and for more complex scenarios [`interop`]
may be a good resource as it shows examples of many of the gRPC features.

### Rust Version

`tonic`'s MSRV is `1.88`.

### Dependencies

[`tonic-build`] uses `protoc` [Protocol Buffers compiler] in some APIs which compile Protocol Buffers resource files such as [`tonic_build::compile_protos()`].

[Protocol Buffers compiler]: https://protobuf.dev/downloads/
[`tonic_build::compile_protos()`]: https://docs.rs/tonic-build/latest/tonic_build/fn.compile_protos.html

## Getting Help

First, see if the answer to your question can be found in the API documentation.
If the answer is not there, there is an active community in
the [Tonic Discord channel][discord]. We would be happy to try to answer your
question. If that doesn't work, try opening an [issue] with the question.

[issue]: https://github.com/grpc/grpc-rust/issues/new/choose

## Project Layout

- [`tonic`]: Generic gRPC and HTTP/2 client/server implementation.
- [`tonic-build`]: [`prost`] based service
阅读完整原文

项目深度分析 AI 生成

基于Tonic的轻量级gRPC微服务API网关与转换服务

产品构想构建一个独立、开箱即用的高性能轻量网关,利用Tonic作为核心引擎,支持动态协议转换(HTTP/JSON到gRPC)、限流、身份验证和JWT校验。
核心功能Protobuf文件动态注册与热加载;HTTP/JSON到gRPC自动转码代理;基于Token的认证与细粒度速率限制;OpenTelemetry可观测性集成导出。
目标用户采用Rust构建微服务但前端仍为Web/移动端的初创团队与中型企业。
难度/周期中等 · 2-3个月 · 成本:极低(主要为开发机器与测试用云服务)
收费模式采用Open-Core模式,核心网关开源,高级企业插件(动态RBAC、分布式限流集群同步、企业SSO)按年订阅收费。
竞争风险需与成熟网关(如Envoy、Kong、Tyk)竞争,必须主打低资源占用、轻量与Rust原生效能。
依据 已验证事实

Rust gRPC协议自动化测试与Mocking平台

产品构想针对gRPC(特别是双向流Streaming)调试困难痛点,开发基于Desktop/CLI的测试工具,支持反射解析、长连接流式Mock和基准压力测试。
核心功能支持Server Reflection动态获取接口定义;全流程双向流交互调试UI/CLI;基于Tonic的高性能并发压力测试引擎并输出延迟报告;CI/CD集成Mock服务。
目标用户后端测试工程师、微服务开发者、QA团队。
难度/周期较低 · 1-2个月 · 成本:低(基础开发工具与静态网站托管)
收费模式个人基础功能免费,团队协作版(跨环境配置云同步、自动化回归测试报告导出、高级负载生成)订阅收费。
竞争风险市场上有Postman、BloomRPC、Kreya等现有工具,需要突出品质上的流测试深度与压测吞吐优势。
依据 数据支持的判断

企业级Tonic性能审计与微服务接入顾问服务

产品构想为正在将Go/Java或C++服务迁移至Rust的企业提供架构咨询、Tonic连接池与负载均衡调优、双向流内存泄漏排查及代码审计。
核心功能Tonic并发模型与Tokio运行时调优咨询;端到端TLS/mTLS加密配置排查;Protobuf向后兼容与版本演进策略规范制定;定制化中间件开发。
目标用户进行技术栈向Rust迁移的金融科技、分布式存储及Web3基础设施团队。
难度/周期高(依赖深厚的网络底层与Rust能力) · 即时(按项目或工时计费) · 成本:极低(纯人力交付)
收费模式按咨询项目收费或按人天咨询费结算,提供SLA支持合同。
竞争风险客户群相对小众,获客周期较长,个人品牌影响力是核心瓶颈。
依据 AI推测
AI 基于仓库公开数据分析生成,含推测成分,不构成收益承诺。
报告会保存到 个人中心

竞品与相似项目 GitHub Search 真实检索

项目中文简介Stars语言
tikv/grpc-rs 中文介绍暂未生成
The gRPC library for Rust built on C Core library and future
1,847 Rust
steadylearner/Rust-Full-Stack 中文介绍暂未生成
Rust projects here are easy to use. There are blog posts for
1,579 Rust
stepancheg/grpc-rust 中文介绍暂未生成
Rust implementation of gRPC
1,366 Rust
connectrpc/connect-rust 中文介绍暂未生成
An implementation of the ConnectRPC, gRPC, and gRPC-Web for
540 Rust
containerd/ttrpc-rust 中文介绍暂未生成
Rust implementation of ttrpc (GRPC for low-memory environmen
373 Rust
以上为通过 GitHub 官方 Search API 检索的相似项目,功能差异与优劣势需进一步人工确认,配置 AI 后可生成对比分析。

项目优势与风险

技术成熟度创建于 2019-08-09,近 30 天仍在推送,发布过 48 个 Release
社区活跃Star 12,549 / Fork 1,282 / Issue 346(数据支持,可自行核实)
许可证MIT
主要风险上游项目方向可能变化;同赛道竞争者较多(见竞品表);热度与需求不完全等价

安装与使用

此项目未提供 Docker 镜像,安装步骤以原仓库 README 为准(涉及依赖安装与环境配置,对新手门槛较高)。