edc_connector_client/lib.rs
1//! Experimental client for EDC (Eclipse Dataspace Connector)
2//!
3//! You can use edc-connector-client this lines in your `Cargo.toml`
4//!
5//! ```toml
6//! [dependencies]
7//! edc-connector-client = "<version>"
8//! ```
9//!
10//! Here it is an usage example:
11//!
12//!
13//! ```rust,no_run
14//!
15//! use edc_connector_client::{EdcConnectorClient, Auth};
16//!
17//!
18//!#[tokio::main]
19//!async fn main() -> Result<(), Box<dyn std::error::Error>> {
20//!
21//! let client = EdcConnectorClient::builder()
22//! .management_url("http://myedc")
23//! .with_auth(Auth::api_token("password"))
24//! .build()?;
25//!
26//! let asset = client.assets().get("1").await?;
27//! println!("Got {:?}", asset);
28//!
29//! Ok(())
30//!}
31//!
32
33pub mod api;
34mod client;
35mod error;
36
37pub mod types;
38
39pub use client::{Auth, EdcConnectorClient};
40pub use error::{
41 BuilderError, ConversionError, Error, ManagementApiError, ManagementApiErrorDetail,
42 ManagementApiErrorDetailKind,
43};
44
45pub const EDC_NAMESPACE: &str = "https://w3id.org/edc/v0.0.1/ns/";
46pub const DATASPACE_PROTOCOL: &str = "dataspace-protocol-http";
47
48pub type EdcResult<T> = Result<T, Error>;