14 releases

0.3.8 Feb 21, 2025
0.3.7 Dec 19, 2024
0.3.5 Nov 7, 2024
0.3.4 Oct 7, 2024
0.1.1 May 27, 2024

#106 in HTTP client

Download history 35/week @ 2024-11-15 9/week @ 2024-11-22 162/week @ 2024-11-29 76/week @ 2024-12-06 262/week @ 2024-12-13 52/week @ 2024-12-20 32/week @ 2024-12-27 46/week @ 2025-01-03 31/week @ 2025-01-10 9/week @ 2025-01-17 9/week @ 2025-01-24 71/week @ 2025-01-31 19/week @ 2025-02-07 21/week @ 2025-02-14 200/week @ 2025-02-21 17/week @ 2025-02-28

262 downloads per month
Used in 2 crates

Apache-2.0

87KB
2.5K SLoC

EDC-rs

Rust client and tools for EDC.

edc-connector-client

A Rust client for EDC.

Installation

Install from crates.io

[dependencies]
edc-connector-client = "0.1"

Examples

Basic usage

Fetching an asset with id 1 and reading the description property as string.

use edc_connector_client::{Auth, EdcConnectorClient};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = EdcConnectorClient::builder()
        .management_url("http://myedc")
        .with_auth(Auth::api_token("password"))
        .build()?;

    let asset = client.assets().get("1").await?;

    println!("Got {:?}", asset);

    println!(
        "Property description: {:?}",
        asset.property::<String>("description").unwrap()
    );

    Ok(())
}

Development

Compiling

git clone https://github.com/wolf4ood/edc-rs.git
cd edc-rs
cargo build

Running Tests

Some tests run against a running instance of EDC.

You can use docker compose to start an instance for testing.

docker compose -f testing/docker-compose.yml up -d
cargo test 

Dependencies

~5–16MB
~211K SLoC