pub struct UniversalResolver { /* private fields */ }Expand description
A resolver that dispatches to method-specific resolvers.
Ships with KeyDidResolver and NdnDidResolver pre-registered.
Additional resolvers can be added with UniversalResolver::with.
Implementations§
Source§impl UniversalResolver
impl UniversalResolver
Sourcepub fn new() -> UniversalResolver
pub fn new() -> UniversalResolver
Create a resolver with KeyDidResolver and NdnDidResolver registered.
Sourcepub fn with(self, resolver: impl DidResolver + 'static) -> UniversalResolver
pub fn with(self, resolver: impl DidResolver + 'static) -> UniversalResolver
Register an additional resolver. Replaces any existing resolver for the same method.
Sourcepub async fn resolve(&self, did: &str) -> DidResolutionResult
pub async fn resolve(&self, did: &str) -> DidResolutionResult
Resolve a DID, returning the full W3C DidResolutionResult.
Sourcepub async fn resolve_document(&self, did: &str) -> Result<DidDocument, DidError>
pub async fn resolve_document(&self, did: &str) -> Result<DidDocument, DidError>
Convenience: resolve and return just the DidDocument.
Maps W3C resolution errors to DidError for simpler call sites.
Trait Implementations§
Source§impl Default for UniversalResolver
impl Default for UniversalResolver
Source§fn default() -> UniversalResolver
fn default() -> UniversalResolver
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for UniversalResolver
impl !RefUnwindSafe for UniversalResolver
impl Send for UniversalResolver
impl Sync for UniversalResolver
impl Unpin for UniversalResolver
impl !UnwindSafe for UniversalResolver
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more