πTonic framework
Crate tonic
A Rust implementation of gRPC, a high performance, open source, general RPC framework that puts mobile and HTTP/2 first. And it is a gRPC over HTTP/2 implementation focused on:
high performance
interoperability
flexibility
And the library was created to have first class support of async/await and to act as a core building block for production systems wriiten in Rust.
Features Flags
channel
Enables just the full featured channel/client portion of thetransport
featurecodegen
Enables all the required exports and optional dependencies required fortonic-build
. Enabled by default.tls
Enables therustls
based TLS options for thetransport
feature. Not enabled by default.tls-roots
Adds system trust roots torustls
based gRPC client using therustls-native-certs
crate. Not enabled by default.tls-webpki-roots
Add the standard trust roots from thewebpki-roots
crate torustls
based gRPC clients. Not enabled by default.gzip
Enables compressing requests, responses, and streams. Depends on flate2. Not enabled by default. Replaces thecompression
flag from earlier versions of tonic(<=0.7>).
Usage
Tower provides an abstraction layer, and generic implementation of various middleware. This menas that the tower
crate on its own does not provide a working implementation of a network client ot server. Instead, Tower's Service trait provides an integration point between application code, libraries providing middleware implementations, and libraries that implement servers and/or clients for various network protocols.
Depending on your particulat use case, you might use Tower in several ways:
Implementing application logic for a networked program
Implementing middleware to add custom behavior to network clients and servers in a reusable manner
Implementing a network protocol
Last updated