Dapr SDK for Rust - Alpha
Go to file
Cyril Scetbon bef6e3b5e5
Upgrade axum to 0.7.4 (#121)
* Upgrade Axum to 0.7.4

Signed-off-by: Cyril Scetbon <cscetbon@gmail.com>

* Export Axum crate

Signed-off-by: Cyril Scetbon <cscetbon@gmail.com>

* Upgrade Axum in macros as well

Signed-off-by: Cyril Scetbon <cscetbon@gmail.com>

* Upgrade crates that depend on Axum

Signed-off-by: Cyril Scetbon <cscetbon@gmail.com>

* Use axum from dapr::server::actor

Signed-off-by: Cyril Scetbon <cscetbon@gmail.com>

* Remove trailing spaces and fix typos

Signed-off-by: Cyril Scetbon <cscetbon@gmail.com>

* Format file

Signed-off-by: Cyril Scetbon <cscetbon@gmail.com>

* Upgrade env_logger and toolchain

Signed-off-by: Cyril Scetbon <cscetbon@gmail.com>

* Trim spaces and remove useless quotes

Signed-off-by: Cyril Scetbon <cscetbon@gmail.com>

* Use named parameter

Signed-off-by: Cyril Scetbon <cscetbon@gmail.com>

* Run cargo fmt

Signed-off-by: Cyril Scetbon <cscetbon@gmail.com>

---------

Signed-off-by: Cyril Scetbon <cscetbon@gmail.com>
2024-02-22 18:20:58 -08:00
.github/workflows Upgrade axum to 0.7.4 (#121) 2024-02-22 18:20:58 -08:00
dapr/proto Updates protos from release-1.13.0 (#120) 2024-02-16 07:42:38 -08:00
examples Upgrade axum to 0.7.4 (#121) 2024-02-22 18:20:58 -08:00
macros Upgrade axum to 0.7.4 (#121) 2024-02-22 18:20:58 -08:00
src Upgrade axum to 0.7.4 (#121) 2024-02-22 18:20:58 -08:00
.gitignore Initial implementation of actor runtime (#99) 2024-01-09 10:31:23 -08:00
CONTRIBUTING.md Add DCO requirements and updated code of conduct (#67) 2022-01-20 14:46:39 -08:00
Cargo.toml Upgrade axum to 0.7.4 (#121) 2024-02-22 18:20:58 -08:00
LICENSE update license (#66) 2022-01-19 13:30:31 -08:00
README.md Updating protos for Dapr 1.12 (#102) 2023-09-11 13:14:14 -07:00
build.rs Invoke examples (#85) 2023-02-03 17:45:49 -08:00
rustfmt.toml Invoke examples (#85) 2023-02-03 17:45:49 -08:00
update-protos.sh Set `update-protos.sh` hashbang to `#!/usr/bin/env bash` (#95) 2023-05-31 10:15:25 -05:00

README.md

Dapr SDK for Rust

Crates.io Build Status License: Apache 2.0 FOSSA Status

⚠ Work in Progress ⚠

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

Prerequisites

Ensure you have Rust version 1.40 or higher installed. If not, install Rust here.

How to use

Add the following to your Cargo.toml file:

[dependencies]
dapr = "0.13.0"

Here's a basic example to create a client:

use dapr;

async fn main() -> Result<(), Box<dyn std::error::Error>> {
    // Get the Dapr port and create a connection
    let port: u16 = std::env::var("DAPR_GRPC_PORT")?.parse()?;
    let addr = format!("https://127.0.0.1:{}", port);

    // Create the client
    let mut client = dapr::Client::<dapr::client::TonicClient>::connect(addr).await?;

Explore more examples

Browse through more examples to understand the SDK better: View examples

Building

To build the SDK run:

cargo build

Note: The protobuf client generation is built into cargo build process so updating the proto files under dapr/ is enough to update the protobuf client.

Updating .proto files from upstream Dapr

To fetch the latest .proto files from Dapr execute the script update-protos.sh:

./update-protos.sh

By default, the script fetches the latest proto updates from the master branch of the Dapr repository. If you need to choose a specific release or version, use the -v flag:

./update-protos.sh -v v1.12.0