pub struct DidDocumentBuilder { /* private fields */ }Expand description
Builds a DidDocument, reporting the first invariant violation at build.
Implementations§
Source§impl DidDocumentBuilder
impl DidDocumentBuilder
Sourcepub fn also_known_as(self, uri: Uri) -> Self
pub fn also_known_as(self, uri: Uri) -> Self
Adds an alsoKnownAs URI.
Sourcepub fn controller(self, did: Did) -> Self
pub fn controller(self, did: Did) -> Self
Adds a controller; one controller serializes as a string, more as an array.
Sourcepub fn verification_method(
self,
method: VerificationMethod,
relationships: impl IntoIterator<Item = VerificationRelationship>,
) -> Self
pub fn verification_method( self, method: VerificationMethod, relationships: impl IntoIterator<Item = VerificationRelationship>, ) -> Self
Adds a verification method under verificationMethod, referenced from relationships.
Sourcepub fn embedded_method(
self,
relationship: VerificationRelationship,
method: VerificationMethod,
) -> Self
pub fn embedded_method( self, relationship: VerificationRelationship, method: VerificationMethod, ) -> Self
Embeds a verification method in relationship, usable for that purpose only.
Sourcepub fn property(self, name: impl Into<String>, value: impl Into<Value>) -> Self
pub fn property(self, name: impl Into<String>, value: impl Into<Value>) -> Self
Adds an extension property; a core property name is refused at
build with DocumentError::ReservedProperty.
Sourcepub fn build(self) -> Result<DidDocument, DocumentError>
pub fn build(self) -> Result<DidDocument, DocumentError>
Trait Implementations§
Source§impl Clone for DidDocumentBuilder
impl Clone for DidDocumentBuilder
Auto Trait Implementations§
impl Freeze for DidDocumentBuilder
impl RefUnwindSafe for DidDocumentBuilder
impl Send for DidDocumentBuilder
impl Sync for DidDocumentBuilder
impl Unpin for DidDocumentBuilder
impl UnsafeUnpin for DidDocumentBuilder
impl UnwindSafe for DidDocumentBuilder
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