pub struct DidDocument {
pub context: Vec<String>,
pub id: String,
pub controller: String,
pub verification_method: Vec<VerificationMethod>,
pub authentication: Vec<String>,
pub assertion_method: Option<Vec<String>>,
pub service: Option<Vec<Service>>,
pub created: DateTime<Utc>,
pub updated: DateTime<Utc>,
pub proof: Option<DocumentProof>,
}Expand description
A DID Document describing an agent’s keys and services.
Fields§
§context: Vec<String>JSON-LD context
id: StringThe DID this document describes
controller: StringController of this DID (usually self)
verification_method: Vec<VerificationMethod>Verification methods (public keys)
authentication: Vec<String>Keys that can authenticate as this DID
assertion_method: Option<Vec<String>>Keys that can make assertions
service: Option<Vec<Service>>Service endpoints
created: DateTime<Utc>When this document was created
updated: DateTime<Utc>When this document was last updated
proof: Option<DocumentProof>Proof of authenticity
Implementations§
Source§impl DidDocument
impl DidDocument
Sourcepub fn add_service(self, id: &str, type_: &str, endpoint: &str) -> Self
pub fn add_service(self, id: &str, type_: &str, endpoint: &str) -> Self
Add a service endpoint.
Sourcepub fn with_handshake_endpoint(self, endpoint: &str) -> Self
pub fn with_handshake_endpoint(self, endpoint: &str) -> Self
Add the handshake service endpoint.
Sourcepub fn handshake_endpoint(&self) -> Option<&str>
pub fn handshake_endpoint(&self) -> Option<&str>
Get the handshake endpoint if present.
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
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