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

DID resolver.

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§

source

async fn resolve_representation<'a>( &'a self, did: &'a DID, options: Options, ) -> Result<Output<Vec<u8>>, Error>

Resolves a DID representation.

Fetches the DID document representation referenced by the input DID using the given options.

See: https://www.w3.org/TR/did-core/#did-resolution

Provided Methods§

source

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.

See: https://www.w3.org/TR/did-core/#did-resolution

source

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.

See: https://www.w3.org/TR/did-core/#did-resolution

source

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.

See: Document::into_any_verification_method().

source

async fn dereference_primary<'a>( &'a self, primary_did_url: &'a PrimaryDIDURL, ) -> Result<DerefOutput<PrimaryContent>, DerefError>

source

async fn dereference_primary_with<'a>( &'a self, primary_did_url: &'a PrimaryDIDURL, resolve_options: Options, ) -> Result<DerefOutput<PrimaryContent>, DerefError>

source

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

source

async fn dereference_with<'a>( &'a self, did_url: &'a DIDURL, options: Options, ) -> Result<DerefOutput, DerefError>

source

async fn dereference<'a>( &'a self, did_url: &'a DIDURL, ) -> Result<DerefOutput, DerefError>

source

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.

source

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.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<T0: DIDMethodResolver> DIDResolver for (T0,)

source§

async fn resolve_representation<'a>( &'a self, did: &'a DID, options: Options, ) -> Result<Output<Vec<u8>>, Error>

source§

impl<T0: DIDMethodResolver, T1: DIDMethodResolver> DIDResolver for (T0, T1)

source§

async fn resolve_representation<'a>( &'a self, did: &'a DID, options: Options, ) -> Result<Output<Vec<u8>>, Error>

source§

impl<T0: DIDMethodResolver, T1: DIDMethodResolver, T2: DIDMethodResolver> DIDResolver for (T0, T1, T2)

source§

async fn resolve_representation<'a>( &'a self, did: &'a DID, options: Options, ) -> Result<Output<Vec<u8>>, Error>

source§

impl<T0: DIDMethodResolver, T1: DIDMethodResolver, T2: DIDMethodResolver, T3: DIDMethodResolver> DIDResolver for (T0, T1, T2, T3)

source§

async fn resolve_representation<'a>( &'a self, did: &'a DID, options: Options, ) -> Result<Output<Vec<u8>>, Error>

source§

impl<T0: DIDMethodResolver, T1: DIDMethodResolver, T2: DIDMethodResolver, T3: DIDMethodResolver, T4: DIDMethodResolver> DIDResolver for (T0, T1, T2, T3, T4)

source§

async fn resolve_representation<'a>( &'a self, did: &'a DID, options: Options, ) -> Result<Output<Vec<u8>>, Error>

source§

impl<T0: DIDMethodResolver, T1: DIDMethodResolver, T2: DIDMethodResolver, T3: DIDMethodResolver, T4: DIDMethodResolver, T5: DIDMethodResolver> DIDResolver for (T0, T1, T2, T3, T4, T5)

source§

async fn resolve_representation<'a>( &'a self, did: &'a DID, options: Options, ) -> Result<Output<Vec<u8>>, Error>

source§

impl<T0: DIDMethodResolver, T1: DIDMethodResolver, T2: DIDMethodResolver, T3: DIDMethodResolver, T4: DIDMethodResolver, T5: DIDMethodResolver, T6: DIDMethodResolver> DIDResolver for (T0, T1, T2, T3, T4, T5, T6)

source§

async fn resolve_representation<'a>( &'a self, did: &'a DID, options: Options, ) -> Result<Output<Vec<u8>>, Error>

source§

impl<T0: DIDMethodResolver, T1: DIDMethodResolver, T2: DIDMethodResolver, T3: DIDMethodResolver, T4: DIDMethodResolver, T5: DIDMethodResolver, T6: DIDMethodResolver, T7: DIDMethodResolver> DIDResolver for (T0, T1, T2, T3, T4, T5, T6, T7)

source§

async fn resolve_representation<'a>( &'a self, did: &'a DID, options: Options, ) -> Result<Output<Vec<u8>>, Error>

Implementors§