identity_iota_core/did_resolution/
did_resolution_handler.rsuse crate::rebased::client::IdentityClientReadOnly;
use crate::Error;
use crate::IotaDID;
use crate::IotaDocument;
use crate::Result;
#[cfg_attr(feature = "send-sync-client-ext", async_trait::async_trait)]
#[cfg_attr(not(feature = "send-sync-client-ext"), async_trait::async_trait(?Send))]
pub trait DidResolutionHandler {
async fn resolve_did(&self, did: &IotaDID) -> Result<IotaDocument>;
}
#[cfg_attr(feature = "send-sync-client-ext", async_trait::async_trait)]
#[cfg_attr(not(feature = "send-sync-client-ext"), async_trait::async_trait(?Send))]
impl DidResolutionHandler for IdentityClientReadOnly {
async fn resolve_did(&self, did: &IotaDID) -> Result<IotaDocument> {
self
.resolve_did(did)
.await
.map_err(|err| Error::DIDResolutionError(err.to_string()))
}
}