edc-web-components 0.5.0

A Rust Web Components with patternfly-yew client for EDC
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use edc_identity_hub_client::models::{DidWeb, Identity};

pub struct DidResolver {
  client: reqwest::Client,
}

impl DidResolver {
  pub fn new(client: reqwest::Client) -> Self {
    Self { client }
  }

  pub async fn resolve(&self, did: &DidWeb) -> edc_identity_hub_client::Result<Identity> {
    let request_builder = self.client.get(did.url());
    let response = request_builder.send().await?;

    Ok(response.json().await?)
  }
}