Struct identity_iota::document::DocumentBuilder
source · pub struct DocumentBuilder { /* private fields */ }
Expand description
A DocumentBuilder
is used to generate a customized Document
.
Implementations§
source§impl DocumentBuilder
impl DocumentBuilder
sourcepub fn new(properties: BTreeMap<String, Value>) -> DocumentBuilder
pub fn new(properties: BTreeMap<String, Value>) -> DocumentBuilder
Creates a new DocumentBuilder
.
sourcepub fn id(self, value: CoreDID) -> DocumentBuilder
pub fn id(self, value: CoreDID) -> DocumentBuilder
Sets the id
value.
sourcepub fn controller(self, value: CoreDID) -> DocumentBuilder
pub fn controller(self, value: CoreDID) -> DocumentBuilder
Adds a value to the controller
set.
sourcepub fn also_known_as(self, value: Url) -> DocumentBuilder
pub fn also_known_as(self, value: Url) -> DocumentBuilder
Adds a value to the alsoKnownAs
set.
sourcepub fn verification_method(self, value: VerificationMethod) -> DocumentBuilder
pub fn verification_method(self, value: VerificationMethod) -> DocumentBuilder
Adds a value to the verificationMethod
set.
sourcepub fn authentication(self, value: impl Into<MethodRef>) -> DocumentBuilder
pub fn authentication(self, value: impl Into<MethodRef>) -> DocumentBuilder
Adds a value to the authentication
set.
sourcepub fn assertion_method(self, value: impl Into<MethodRef>) -> DocumentBuilder
pub fn assertion_method(self, value: impl Into<MethodRef>) -> DocumentBuilder
Adds a value to the assertionMethod
set.
sourcepub fn key_agreement(self, value: impl Into<MethodRef>) -> DocumentBuilder
pub fn key_agreement(self, value: impl Into<MethodRef>) -> DocumentBuilder
Adds a value to the keyAgreement
set.
sourcepub fn capability_delegation(
self,
value: impl Into<MethodRef>
) -> DocumentBuilder
pub fn capability_delegation( self, value: impl Into<MethodRef> ) -> DocumentBuilder
Adds a value to the capabilityDelegation
set.
sourcepub fn capability_invocation(
self,
value: impl Into<MethodRef>
) -> DocumentBuilder
pub fn capability_invocation( self, value: impl Into<MethodRef> ) -> DocumentBuilder
Adds a value to the capabilityInvocation
set.
sourcepub fn service(self, value: Service) -> DocumentBuilder
pub fn service(self, value: Service) -> DocumentBuilder
Adds a value to the service
set.
sourcepub fn build(self) -> Result<CoreDocument, Error>
pub fn build(self) -> Result<CoreDocument, Error>
Returns a new Document
based on the DocumentBuilder
configuration.
Trait Implementations§
source§impl Clone for DocumentBuilder
impl Clone for DocumentBuilder
source§fn clone(&self) -> DocumentBuilder
fn clone(&self) -> DocumentBuilder
Returns a copy 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 DocumentBuilder
impl Debug for DocumentBuilder
source§impl Default for DocumentBuilder
impl Default for DocumentBuilder
source§fn default() -> DocumentBuilder
fn default() -> DocumentBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for DocumentBuilder
impl RefUnwindSafe for DocumentBuilder
impl Send for DocumentBuilder
impl Sync for DocumentBuilder
impl Unpin for DocumentBuilder
impl UnwindSafe for DocumentBuilder
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