#microservices #api-bindings

macro dapr-derive

Dapr SDK for Rust

2 releases

0.1.0-alpha.2 Oct 29, 2019
0.1.0-alpha.1 Oct 25, 2019

#8 in #microservice

MIT license

15KB
374 lines

Dapr SDK for Rust

Dapr is a portable, event-driven, serverless runtime for building distributed applications across cloud and edge.

This is the Dapr SDK for Rust, based on the auto-generated protobuf client.

For more info on Dapr and gRPC, visit this link.

Features

  • Dapr Runtime API with dapr::Runtime
  • Dapr Client with #[dapr::service]

Getting Started

Rust Version

dapr 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:

$ rustup install beta
$ rustup component add rustfmt --toolchain beta
$ cargo +beta build

Tutorials

The examples folder contains a Dapr enabled app that receives events (client), and a caller that invokes the Dapr API (caller).

Run the client

$ cargo +beta build --example client
$ dapr run --log-level debug --protocol grpc --port 3500 --grpc-port 3600 --app-id client --app-port 4000 target/debug/examples/client

Run the caller

$ DAPR_GRPC_PORT=3600 cargo +beta run --example caller

Note: If you don't setup a Dapr binding, expect the error message

Error: Status { code: Unknown, message: "ERR_INVOKE_OUTPUT_BINDING: couldn't find output binding storage" }

License

This project is licensed under the MIT license.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in Tonic by you, shall be licensed as MIT, without any additional terms or conditions.

Dependencies

~1.5MB
~34K SLoC