Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
gRPC-rs
gRPC-rs
is a Rust wrapper of gRPC Core. gRPC is a high performance, open source universal RPC framework that puts mobile and HTTP/2 first.
Status
This project is still under development. The following features with the check marks are supported:
- Basic asynchronous unary/steaming call
- SSL
- Generic call
- Connection level compression
- Interoperability test
- QPS benchmark
- Custom metadata
- Health check
- Reflection
- Authentication
- Load balance
Prerequisites
- CMake >= 3.8.0
- Rust >= 1.19.0
- binutils >= 2.22
- LLVM and Clang >= 3.9 recommended by bindgen
- By default, the secure feature is enabled, therefore Go (>=1.7) is required.
For Linux and MacOS, you also need to install gcc (or clang) too.
For Windows, you also need to install following software:
- Active State Perl
- yasm
- Visual Studio 2015+
Build
$ git submodule update --init --recursive # if you just cloned the repository
$ cargo build
Error linking OpenSSL
If you're getting linker errors when building your project using gRPC-rs
, head
down to the openssl
feature section for a possible fix.
Usage
To generate the sources from proto files:
Option 1 - Manual Generation
- Install the protobuf compiler:
$ cargo install protobuf-codegen
- Install the gRPC compiler:
$ cargo install grpcio-compiler
- Generate the sources:
$ protoc --rust_out=. --grpc_out=. --plugin=protoc-gen-grpc=`which grpc_rust_plugin` example.proto
Option 2 - Programmatic Generation
Programmatic generation can be used to generate Rust modules from proto files
via your build.rs
by using protoc-grpcio.
For more information and examples see README.
To include this project as a dependency:
[dependencies]
grpcio = "0.4"
Feature secure
secure
feature enables support for TLS encryption and some authentication
mechanism. When you do not need it, for example when working in intranet,
you can disable it by using the following configuration:
[dependencies]
grpcio = { version = "0.4", default-features = false, features = ["protobuf-codec"] }
Feature openssl
gRPC-rs
comes vendored with gRPC Core
, which by default uses BoringSSL
instead of OpenSSL. This may cause linking issues due to symbol clashes and/or
missing symbols when another one of your dependencies uses OpenSSL. To resolve
this, you can tell gRPC-rs
to use OpenSSL too by specifying "openssl"
in
your Cargo.toml
's features list for gprcio
. E.g.:
[]
= { = "0.4.4", = ["openssl"] }
Performance
See benchmark to find out how to run a benchmark by yourself.
Cross Compile
See cross_compile