pub struct DidDocument {
pub context: Vec<String>,
pub id: String,
pub controller: Option<String>,
pub verification_method: Vec<VerificationMethod>,
pub authentication: Vec<String>,
pub assertion_method: Vec<String>,
pub key_agreement: Vec<String>,
pub capability_invocation: Vec<String>,
pub capability_delegation: Vec<String>,
pub service: Vec<Service>,
}Expand description
W3C DID Document
A DID Document contains information associated with a DID, including verification methods and service endpoints.
Fields§
§context: Vec<String>JSON-LD context
id: StringThe DID subject
controller: Option<String>Optional controller DID
verification_method: Vec<VerificationMethod>Verification methods (public keys)
authentication: Vec<String>Authentication verification methods
assertion_method: Vec<String>Assertion/credential issuance verification methods
key_agreement: Vec<String>Key agreement verification methods
capability_invocation: Vec<String>Capability invocation verification methods
capability_delegation: Vec<String>Capability delegation verification methods
service: Vec<Service>Service endpoints
Implementations§
Source§impl DidDocument
impl DidDocument
Sourcepub fn primary_verification_method(&self) -> Option<&VerificationMethod>
pub fn primary_verification_method(&self) -> Option<&VerificationMethod>
Get the primary verification method
Sourcepub fn get_verification_method(&self, id: &str) -> Option<&VerificationMethod>
pub fn get_verification_method(&self, id: &str) -> Option<&VerificationMethod>
Get a verification method by ID
Sourcepub fn get_service(&self, id: &str) -> Option<&Service>
pub fn get_service(&self, id: &str) -> Option<&Service>
Get a service by ID
Trait Implementations§
Source§impl Clone for DidDocument
impl Clone for DidDocument
Source§fn clone(&self) -> DidDocument
fn clone(&self) -> DidDocument
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 moreSource§impl Debug for DidDocument
impl Debug for DidDocument
Source§impl<'de> Deserialize<'de> for DidDocument
impl<'de> Deserialize<'de> for DidDocument
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for DidDocument
impl PartialEq for DidDocument
Source§impl Serialize for DidDocument
impl Serialize for DidDocument
impl Eq for DidDocument
impl StructuralPartialEq for DidDocument
Auto Trait Implementations§
impl Freeze for DidDocument
impl RefUnwindSafe for DidDocument
impl Send for DidDocument
impl Sync for DidDocument
impl Unpin for DidDocument
impl UnwindSafe for DidDocument
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.