diff --git a/README.md b/README.md index 9996bc2..01a4da8 100644 --- a/README.md +++ b/README.md @@ -35,9 +35,7 @@ contains the tools to build clients and servers from [`protobuf`] definitions. Examples can be found in [`tonic-examples`] and for more complex scenarios [`tonic-interop`] may be a good resource as it shows examples of many of the gRPC features. -### Examples - -#### Rust Version +### Rust Version `tonic` currently works on rust `1.39-beta` and above as it requires support for the `async_await` feature. To install the beta simply follow the commands below: @@ -48,6 +46,20 @@ $ rustup component add rustfmt --toolchain beta $ cargo +beta build ``` +### Examples + +
+ Helloworld + +#### `Cargo.toml` + +```toml +tonic = "*" +bytes = "0.4" +prost = "0.5" +prost-derive = "0.5" +``` + #### Protobuf ```protobuf @@ -70,6 +82,14 @@ message HelloReply { } ``` +#### `build.rs` + +```rust +fn main() { + tonic_build::compile_protos("proto/helloworld/helloworld.proto").unwrap(); +} +``` + #### Client ```rust @@ -146,6 +166,8 @@ async fn main() -> Result<(), Box> { } ``` +
+ ## Getting Help First, see if the answer to your question can be found in the API documentation.