pub trait DidResolver: Send + Sync {
// Required methods
fn method(&self) -> &'static str;
fn resolve<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
did: &'life1 Did,
options: &'life2 ResolutionOptions,
) -> Pin<Box<dyn Future<Output = Result<ResolutionResult, ResolutionError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
}Expand description
Resolves the DIDs of one method (DID Resolution “DID Resolution Algorithm”).
A resolver is registered with a Resolver under method and receives
only DIDs of that method. It is Send + Sync and resolution is async because most methods
fetch the document over the network or from a registry.
A failed resolution may be reported either as Err, or as an Ok result whose resolution
metadata carries the error, which is the shape a method that builds a full
ResolutionResult (a client of a remote resolver, say) produces anyway. The Resolver
normalizes both to Err.
Required Methods§
Sourcefn resolve<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
did: &'life1 Did,
options: &'life2 ResolutionOptions,
) -> Pin<Box<dyn Future<Output = Result<ResolutionResult, ResolutionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn resolve<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
did: &'life1 Did,
options: &'life2 ResolutionOptions,
) -> Pin<Box<dyn Future<Output = Result<ResolutionResult, ResolutionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Resolves did, whose method is method, with options.
On success the result holds the document with id equal to did (or to the
canonicalId of the document metadata) and whatever metadata the method knows. A
deactivated DID resolves to a result without a document whose document metadata has
deactivated: true.
§Errors
A ResolutionError whose kind is NotFound for a DID
that does not exist,
RepresentationNotSupported for an
accept the method cannot produce, or InternalError
for an unexpected failure such as a network error. Attach what caused it with
ResolutionError::with_source and ResolutionError::with_detail, so callers can tell
one failure from another.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl<T: DidResolver + ?Sized> DidResolver for &T
impl<T: DidResolver + ?Sized> DidResolver for &T
fn method(&self) -> &'static str
fn resolve<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
did: &'life1 Did,
options: &'life2 ResolutionOptions,
) -> Pin<Box<dyn Future<Output = Result<ResolutionResult, ResolutionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Source§impl<T: DidResolver + ?Sized> DidResolver for Arc<T>
impl<T: DidResolver + ?Sized> DidResolver for Arc<T>
fn method(&self) -> &'static str
fn resolve<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
did: &'life1 Did,
options: &'life2 ResolutionOptions,
) -> Pin<Box<dyn Future<Output = Result<ResolutionResult, ResolutionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Source§impl<T: DidResolver + ?Sized> DidResolver for Box<T>
impl<T: DidResolver + ?Sized> DidResolver for Box<T>
fn method(&self) -> &'static str
fn resolve<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
did: &'life1 Did,
options: &'life2 ResolutionOptions,
) -> Pin<Box<dyn Future<Output = Result<ResolutionResult, ResolutionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Implementors§
impl DidResolver for DidJwk
did-jwk and (crate features did-jwk or did-key or did-web) only.impl DidResolver for DidKey
did-key and (crate features did-jwk or did-key or did-web) only.impl<C: HttpClient> DidResolver for DidWeb<C>
did-web and (crate features did-jwk or did-key or did-web) only.