Git Product home page Git Product logo

rust-sdk's Introduction

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

rust-sdk's People

Contributors

pkedy avatar gdhuper avatar artursouza avatar amanbha avatar tcnghia avatar deepanshua avatar pruthvidhodda avatar aaroncrawfis avatar dmitsh avatar joshvanl avatar robertojrojas avatar rylev avatar t-eckert avatar rumblefrog avatar tottoto avatar hauju avatar yaron2 avatar willtsai avatar nicklarsennz avatar hugome avatar franpog859 avatar elena-kolevska avatar dwhiteddsoft avatar wcs1only avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.