grpc-rust README

The project's README from github.com/grpc/grpc-rust. As one markdown file: README.md.

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

Note: tonic's master branch is currently preparing breaking changes. For the most recently released code, look to the 0.14.x branch.

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 Documentation Crates.io

Examples | Website | Docs | Chat

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

Getting Started

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().

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. We would be happy to try to answer your question. If that doesn't work, try opening an issue with the question.

Project Layout

Contributing

:balloon: Thanks for your help improving the project! We are so happy to have you! We have a contributing guide to help you get involved in the Tonic project.

License

This project is licensed under the MIT license.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in Tonic by you, shall be licensed as MIT, without any additional terms or conditions.

grpc-rust (grpc/grpc-rust)

Searching Database…

12.5K ·GitHub
What is this?tonic — a native Rust gRPC client and server implementation. It runs over HTTP/2 with first-class async/await support and is built as a core building block for production systems written in Rust.
Is it a library I code against, or an app I deploy?A library, not a deployed app. It has three main parts: the generic gRPC implementation, a fast HTTP/2 implementation based on hyper and tokio, and prost-powered codegen that builds clients and servers from protobuf definitions.
How do I get started with it?Start with the helloworld tutorial — a basic example aimed at first-time users — then routeguide for a complete example covering all features. The examples directory shows TLS, load balancing and bi-directional streaming.
What do I need installed besides Rust?Rust 1.88 or newer (the stated MSRV), plus protoc — the Protocol Buffers compiler — since some tonic-build APIs such as tonic_build::compile_protos() use it to compile .proto files.
Is the master branch safe to build on right now?Not exactly: the master branch is currently preparing breaking changes. For the most recently released code, the README points to the 0.14.x branch.
What gRPC features does it support out of the box?Bi-directional streaming, TLS backed by rustls, load balancing, custom metadata, authentication and health checking, all on high-performance async I/O. A set of generic traits also lets it run over any HTTP/2 implementation and with any encoding.
Why was tonic created instead of using an existing gRPC library?The README says it was created to have first-class async/await support and to act as a core building block for production systems written in Rust, layering its gRPC implementation on the tokio and hyper stack.
Can it talk to gRPC services written in other languages?Yes. Interoperability is a listed design goal, and the repo ships a dedicated interop test suite exercising many gRPC features, so it works with standard-conformant gRPC implementations.
What do tonic-health and tonic-reflection add?tonic-health implements the standard gRPC health checking service (and doubles as an example of unary and response-streaming calls), tonic-reflection adds gRPC reflection, and tonic-types provides gRPC Well Known Types utilities.
Creator
grpc
Size
83.6 MB
Stars
12.5K
Age
7y
Commits · 90 Days