Rust implementation of gRPC protocol, under development.
Some development questions in FAQ.
It basially works. See grpc-examples/src/bin/greeter_{client,server}{,_async}.rs
. It can be tested
for example with go client:
```
$ cargo run --bin greeter_server
$ cargo run --bin greeterserverasync
$ go get -u google.golang.org/grpc/examples/helloworld/greeterclient $ greeterserver
$ cargo run --bin greeter_client rust
message: "Hello rust"
$ cargo run --bin greeterclientasync rust
message: "Hello rust"
$ go get -u google.golang.org/grpc/examples/helloworld/greeterclient $ greeterclient rust
2016/08/19 05:44:45 Greeting: Hello rust ```
Client and server are implemented asynchronously, and sync versions are thin wrappers around async counterparts.
bash
cargo install protobuf
cargo install grpc-compiler
These commands install protoc-gen-rust
and protoc-gen-rust-grpc
to ~/.cargo/bin
, which should be added to $PATH
.
bash
cd $YOURPROJECT
mkdir -p src
protoc --rust_out=src *.proto
protoc --rust-grpc_out=src *.proto
In Cargo.toml:
ini
[dependencies]
grpc = "0.*"
protobuf = "1.*"
futures = "0.1"
futures-cpupool = "0.1"
In lib.rs
or main.rs
(or any other submodule):
```rust extern crate protobuf; extern crate grpc; extern crate futures; extern crate futures_cpupool;
pub mod myproto; pub mod myproto_grpc; ```
It seems possible, but looks like it requires some more work.
See https://github.com/stepancheg/rust-protobuf/issues/57 and https://github.com/dwrensha/capnpc-rust for more details.
long-tests
directory