ttrpc-rust
is a Rust version of ttrpc. ttrpc is GRPC for low-memory environments.
The ttrpc compiler of ttrpc-rust
ttrpc_rust_plugin
is modified from gRPC compiler of gRPC-rs grpcio-compiler.
To generate the sources from proto files:
-
Install protoc from github.com/protocolbuffers/protobuf
-
Install protobuf-codegen from github.com/pingcap/grpc-rs
-
Install ttrpc_rust_plugin from ttrpc-rust/compiler
-
Generate the sources:
$ protoc --rust_out=. --ttrpc_out=. --plugin=protoc-gen-ttrpc=`which ttrpc_rust_plugin` example.proto
-
Go to the directory
$ cd ttrpc-rust/example
-
Start the server
$ cargo run --example server unix:///tmp/1
-
Start a client
$ cargo run --example client /tmp/1
The version of protobuf-codegen which you are using to generate codes should be exactly same with the version of protobuf library.
The reason is that files generated by protobuf-codegen are compatible only with the same version of runtime