Trait ssi_dids_core::resolution::DIDResolver
source · pub trait DIDResolver {
// Required method
async fn resolve_representation<'a>(
&'a self,
did: &'a DID,
options: Options,
) -> Result<Output<Vec<u8>>, Error>;
// Provided methods
async fn resolve_with<'a>(
&'a self,
did: &'a DID,
options: Options,
) -> Result<Output, Error> { ... }
async fn resolve<'a>(&'a self, did: &'a DID) -> Result<Output, Error> { ... }
async fn resolve_into_any_verification_method<'a>(
&'a self,
did: &'a DID,
) -> Result<Option<DIDVerificationMethod>, Error> { ... }
async fn dereference_primary<'a>(
&'a self,
primary_did_url: &'a PrimaryDIDURL,
) -> Result<DerefOutput<PrimaryContent>, DerefError> { ... }
async fn dereference_primary_with<'a>(
&'a self,
primary_did_url: &'a PrimaryDIDURL,
resolve_options: Options,
) -> Result<DerefOutput<PrimaryContent>, DerefError> { ... }
async fn dereference_primary_with_path_or_query<'a>(
&'a self,
_primary_did_url: &'a PrimaryDIDURL,
) -> Result<DerefOutput<PrimaryContent>, DerefError> { ... }
async fn dereference_with<'a>(
&'a self,
did_url: &'a DIDURL,
options: Options,
) -> Result<DerefOutput, DerefError> { ... }
async fn dereference<'a>(
&'a self,
did_url: &'a DIDURL,
) -> Result<DerefOutput, DerefError> { ... }
fn into_vm_resolver_with<M>(
self,
options: Options,
) -> VerificationMethodDIDResolver<Self, M>
where Self: Sized { ... }
fn into_vm_resolver<M>(self) -> VerificationMethodDIDResolver<Self, M>
where Self: Sized { ... }
}
Expand description
Any type implementing the DID Resolution
algorithm
through the resolve
method
and the DID URL Dereferencing
algorithm through the dereference
method.
This library provides the AnyDidMethod
that implements this trait
by grouping various DID method implementations.
Required Methods§
Provided Methods§
sourceasync fn resolve_with<'a>(
&'a self,
did: &'a DID,
options: Options,
) -> Result<Output, Error>
async fn resolve_with<'a>( &'a self, did: &'a DID, options: Options, ) -> Result<Output, Error>
Resolves a DID with the given options.
Fetches the DID document referenced by the input DID using the given options.
sourceasync fn resolve<'a>(&'a self, did: &'a DID) -> Result<Output, Error>
async fn resolve<'a>(&'a self, did: &'a DID) -> Result<Output, Error>
Resolves a DID.
Fetches the DID document referenced by the input DID using the default options.
sourceasync fn resolve_into_any_verification_method<'a>(
&'a self,
did: &'a DID,
) -> Result<Option<DIDVerificationMethod>, Error>
async fn resolve_into_any_verification_method<'a>( &'a self, did: &'a DID, ) -> Result<Option<DIDVerificationMethod>, Error>
Resolves a DID and extracts one of the verification methods it defines.
This will return the first verification method found, although users should not expect the DID documents to always list verification methods in the same order.
sourceasync fn dereference_primary<'a>(
&'a self,
primary_did_url: &'a PrimaryDIDURL,
) -> Result<DerefOutput<PrimaryContent>, DerefError>
async fn dereference_primary<'a>( &'a self, primary_did_url: &'a PrimaryDIDURL, ) -> Result<DerefOutput<PrimaryContent>, DerefError>
Dereference a DID URL to retrieve the primary content.
See: https://www.w3.org/TR/did-core/#did-url-dereferencing See: https://w3c-ccg.github.io/did-resolution/#dereferencing-algorithm
sourceasync fn dereference_primary_with<'a>(
&'a self,
primary_did_url: &'a PrimaryDIDURL,
resolve_options: Options,
) -> Result<DerefOutput<PrimaryContent>, DerefError>
async fn dereference_primary_with<'a>( &'a self, primary_did_url: &'a PrimaryDIDURL, resolve_options: Options, ) -> Result<DerefOutput<PrimaryContent>, DerefError>
Dereference a DID URL to retrieve the primary content.
See: https://www.w3.org/TR/did-core/#did-url-dereferencing See: https://w3c-ccg.github.io/did-resolution/#dereferencing-algorithm
sourceasync fn dereference_primary_with_path_or_query<'a>(
&'a self,
_primary_did_url: &'a PrimaryDIDURL,
) -> Result<DerefOutput<PrimaryContent>, DerefError>
async fn dereference_primary_with_path_or_query<'a>( &'a self, _primary_did_url: &'a PrimaryDIDURL, ) -> Result<DerefOutput<PrimaryContent>, DerefError>
Dereference a DID URL with a path or query to retrieve the primary content.
This function is called from Self::dereference_primary()
only if
the primary DID url has a path and/or query, and the query does not
include any service.
Users should always call Self::dereference_primary()
.
See: https://www.w3.org/TR/did-core/#did-url-dereferencing See: https://w3c-ccg.github.io/did-resolution/#dereferencing-algorithm
sourceasync fn dereference_with<'a>(
&'a self,
did_url: &'a DIDURL,
options: Options,
) -> Result<DerefOutput, DerefError>
async fn dereference_with<'a>( &'a self, did_url: &'a DIDURL, options: Options, ) -> Result<DerefOutput, DerefError>
Dereference a DID URL.
See: https://www.w3.org/TR/did-core/#did-url-dereferencing See: https://w3c-ccg.github.io/did-resolution/#dereferencing-algorithm
sourceasync fn dereference<'a>(
&'a self,
did_url: &'a DIDURL,
) -> Result<DerefOutput, DerefError>
async fn dereference<'a>( &'a self, did_url: &'a DIDURL, ) -> Result<DerefOutput, DerefError>
Dereference a DID URL.
See: https://www.w3.org/TR/did-core/#did-url-dereferencing See: https://w3c-ccg.github.io/did-resolution/#dereferencing-algorithm
sourcefn into_vm_resolver_with<M>(
self,
options: Options,
) -> VerificationMethodDIDResolver<Self, M>where
Self: Sized,
fn into_vm_resolver_with<M>(
self,
options: Options,
) -> VerificationMethodDIDResolver<Self, M>where
Self: Sized,
Turns this DID resolver into a verification method resolver.
To resolve a verification method, the output resolver will first
resolve the DID using the given options
then pull the referenced
method from the DID document.
sourcefn into_vm_resolver<M>(self) -> VerificationMethodDIDResolver<Self, M>where
Self: Sized,
fn into_vm_resolver<M>(self) -> VerificationMethodDIDResolver<Self, M>where
Self: Sized,
Turns this DID resolver into a verification method resolver.
To resolve a verification method, the output resolver will first resolve the DID then pull the referenced method from the DID document.
This is equivalent to calling
into_vm_resolver_with
with the default options.