Skip to content
Please note that GitHub no longer supports Internet Explorer.

We recommend upgrading to the latest Microsoft Edge, Google Chrome, or Firefox.

Learn more
Rust implementation of gRPC
Rust Shell Go
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
ci Be more specific about istalled version Jan 12, 2020
docs Rename GrpcXxx to grpc::Xxx May 15, 2017
grpc-compiler Sync with latest rust http2 Jan 14, 2020
grpc-examples Remove multi server because tokio 0.2 is multithreaded Jan 20, 2020
grpc-protobuf
grpc Remove one extra allocation when writing a frame Jan 21, 2020
interop Sync with latest rust http2 Jan 14, 2020
long-tests Sync with latest rust http2 Jan 14, 2020
protoc-rust-grpc Set edition = 2018 Jan 14, 2020
.editorconfig code cleanup Aug 24, 2016
.gitignore ignore Vim temp files Mar 3, 2019
.travis.yml Convert CI to ci/run.sh Jan 12, 2020
CHANGELOG.md Update CHANGELOG.md Jan 14, 2020
Cargo.toml Better move reliable tests Jan 12, 2020
LICENSE.txt add a license (MIT) Aug 23, 2016
README.md Update grpc to 0.6 version May 26, 2019
build-all.sh There's no cargo.sh May 14, 2018
update-version.sh Bump version to 0.4.0 May 15, 2018

README.md

grpc-rust

Build Status License crates.io

Rust implementation of gRPC protocol, under development.

Some development questions in FAQ.

Current status

It basically works. See grpc-examples/src/bin/greeter_{client,server}.rs. It can be tested for example with go client:

# start greeter server implemented in rust
$ cargo run --bin greeter_server

# ... or start greeter server implemented in go
$ go get -u google.golang.org/grpc/examples/helloworld/greeter_client
$ greeter_server

# start greeter client implemented in rust
$ cargo run --bin greeter_client rust
> message: "Hello rust"

# ... or start greeter client implemented in go
$ go get -u google.golang.org/grpc/examples/helloworld/greeter_client
$ greeter_client rust
> 2016/08/19 05:44:45 Greeting: Hello rust

Client and server are implemented asynchronously.

How to generate rust code

There are two ways to generate rust code from .proto files

Invoke protoc programmatically with protoc-rust-grpc crate

(Recommended)

Have a look at readme in protoc-rust-grpc crate.

With protoc command and protoc-gen-rust-grpc plugin

Readme

Use generated protos in your project:

In Cargo.toml:

[dependencies]
grpc            = "~0.6"
protobuf        = "~2"
futures         = "~0.1"
futures-cpupool = "~0.1"

[build-dependencies]
protoc-rust-grpc = "0.6.1"

In lib.rs or main.rs (or any other submodule):

extern crate protobuf;
extern crate grpc;
extern crate futures;
extern crate futures_cpupool;

pub mod myproto;
pub mod myproto_grpc;

TODO

  • Fix performance
  • More tests
  • In particular, add more compatibility tests, they live in interop directory
  • Fix all TODO in sources

Related projects

  • grpc-rs — alternative implementation of gRPC in Rust, a wrapper to C++ implementation
  • httpbis — implementation of HTTP/2, which is used by this implementation of gRPC
  • rust-protobuf — implementation of Google Protocol Buffers
You can’t perform that action at this time.