pub struct DocumentBuilder { /* private fields */ }Expand description
Builder for constructing DID documents with a fluent API. Provides controlled construction with validation capabilities.
Implementations§
Source§impl DocumentBuilder
impl DocumentBuilder
Sourcepub fn context(self, context: Vec<String>) -> Self
pub fn context(self, context: Vec<String>) -> Self
Sets the JSON-LD context URLs for the document.
Sourcepub fn add_context(self, context_url: impl Into<String>) -> Self
pub fn add_context(self, context_url: impl Into<String>) -> Self
Adds a single context URL to the document.
Sourcepub fn also_known_as(self, aliases: Vec<String>) -> Self
pub fn also_known_as(self, aliases: Vec<String>) -> Self
Sets all alternative identifiers at once.
Sourcepub fn add_also_known_as(self, alias: impl Into<String>) -> Self
pub fn add_also_known_as(self, alias: impl Into<String>) -> Self
Adds a single alternative identifier.
Sourcepub fn add_service(self, service: Service) -> Self
pub fn add_service(self, service: Service) -> Self
Adds a single service to the document.
Sourcepub fn add_pds_service(self, endpoint: impl Into<String>) -> Self
pub fn add_pds_service(self, endpoint: impl Into<String>) -> Self
Convenience method to add a PDS service.
Sourcepub fn verification_methods(self, methods: Vec<VerificationMethod>) -> Self
pub fn verification_methods(self, methods: Vec<VerificationMethod>) -> Self
Sets all verification methods at once.
Sourcepub fn add_verification_method(self, method: VerificationMethod) -> Self
pub fn add_verification_method(self, method: VerificationMethod) -> Self
Adds a single verification method.
Sourcepub fn add_multikey(
self,
id: impl Into<String>,
controller: impl Into<String>,
public_key_multibase: impl Into<String>,
) -> Self
pub fn add_multikey( self, id: impl Into<String>, controller: impl Into<String>, public_key_multibase: impl Into<String>, ) -> Self
Convenience method to add a Multikey verification method.
Trait Implementations§
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