pub struct DidResolutionResult {
pub did_document: Option<DidDocument>,
pub did_document_metadata: DidDocumentMetadata,
pub did_resolution_metadata: DidResolutionMetadata,
}Expand description
The complete output of a DID resolution operation.
Per W3C DID Core §7.1, resolve(did, options) returns a tuple of:
didResolutionMetadata— how the resolution wentdidDocument— the resolved document (absent on error)didDocumentMetadata— metadata about the document’s current state
Use DidResolutionResult::into_document() to extract the document and
convert resolution errors into a single Result.
Fields§
§did_document: Option<DidDocument>§did_document_metadata: DidDocumentMetadata§did_resolution_metadata: DidResolutionMetadataImplementations§
Source§impl DidResolutionResult
impl DidResolutionResult
Sourcepub fn ok(document: DidDocument) -> DidResolutionResult
pub fn ok(document: DidDocument) -> DidResolutionResult
Successful resolution result.
Sourcepub fn ok_with_metadata(
document: DidDocument,
doc_meta: DidDocumentMetadata,
) -> DidResolutionResult
pub fn ok_with_metadata( document: DidDocument, doc_meta: DidDocumentMetadata, ) -> DidResolutionResult
Successful resolution with document metadata (e.g. deactivated flag).
Sourcepub fn err(
code: DidResolutionError,
message: impl Into<String>,
) -> DidResolutionResult
pub fn err( code: DidResolutionError, message: impl Into<String>, ) -> DidResolutionResult
Failed resolution.
Sourcepub fn into_document(self) -> Result<DidDocument, DidError>
pub fn into_document(self) -> Result<DidDocument, DidError>
Extract the DID Document, mapping resolution errors to a [DidError].
Sourcepub fn is_deactivated(&self) -> bool
pub fn is_deactivated(&self) -> bool
Whether this DID has been deactivated.
Trait Implementations§
Source§impl Clone for DidResolutionResult
impl Clone for DidResolutionResult
Source§fn clone(&self) -> DidResolutionResult
fn clone(&self) -> DidResolutionResult
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for DidResolutionResult
impl RefUnwindSafe for DidResolutionResult
impl Send for DidResolutionResult
impl Sync for DidResolutionResult
impl Unpin for DidResolutionResult
impl UnwindSafe for DidResolutionResult
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