Skip to main content

Crate affinidi_did_resolver_traits

Crate affinidi_did_resolver_traits 

Source
Expand description

Pluggable DID resolution traits.

Provides Resolver (sync) and AsyncResolver (async) traits for decoupling DID resolution from concrete types. External consumers implement these traits for custom DID methods; the SDK composes them with built-in resolvers.

Every Resolver is automatically an AsyncResolver via blanket impl, so the SDK only needs Box<dyn AsyncResolver> for composition.

§Return Convention

Resolvers return Option<Result<Document, ResolverError>>:

  • None — “not my DID, pass to next resolver”
  • Some(Ok(doc)) — resolved successfully
  • Some(Err(e)) — recognized the DID but resolution failed

Structs§

KeyResolver
Resolver for did:key — derives DID Documents from public key material.
PeerResolver
Resolver for did:peer — derives DID Documents from peer DID encoding.

Enums§

MethodName
Discriminant for DID method types — used as HashMap key for resolver dispatch.
ResolverError
Error type for resolver failures.

Traits§

AsyncResolver
Asynchronous DID resolver for methods that require IO.
Resolver
Synchronous DID resolver for methods that require no IO.

Type Aliases§

Resolution
Result type alias for resolver return values.