pub struct IotaDocument {
pub metadata: IotaDocumentMetadata,
/* private fields */
}
Expand description
A DID Document adhering to the IOTA DID method specification.
This extends CoreDocument
.
Fields§
§metadata: IotaDocumentMetadata
The metadata of an IOTA DID document.
Implementations§
Source§impl IotaDocument
impl IotaDocument
Sourcepub fn new(network: &NetworkName) -> IotaDocument
pub fn new(network: &NetworkName) -> IotaDocument
Constructs an empty DID Document with a IotaDID::placeholder
identifier
for the given network
.
Sourcepub fn new_with_id(id: IotaDID) -> IotaDocument
pub fn new_with_id(id: IotaDID) -> IotaDocument
Constructs an empty DID Document with the given identifier.
Sourcepub fn controller(&self) -> impl Iterator<Item = &IotaDID>
pub fn controller(&self) -> impl Iterator<Item = &IotaDID>
Returns an iterator yielding the DID controllers.
Sourcepub fn set_controller<T>(&mut self, controller: T)where
T: IntoIterator<Item = IotaDID>,
pub fn set_controller<T>(&mut self, controller: T)where
T: IntoIterator<Item = IotaDID>,
Sets the value of the document controller.
Note:
- Duplicates in
controller
will be ignored. - Use an empty collection to clear all controllers.
Sourcepub fn also_known_as(&self) -> &OrderedSet<Url>
pub fn also_known_as(&self) -> &OrderedSet<Url>
Returns a reference to the alsoKnownAs
set.
Sourcepub fn also_known_as_mut(&mut self) -> &mut OrderedSet<Url>
pub fn also_known_as_mut(&mut self) -> &mut OrderedSet<Url>
Returns a mutable reference to the alsoKnownAs
set.
Sourcepub fn core_document(&self) -> &CoreDocument
pub fn core_document(&self) -> &CoreDocument
Returns a reference to the underlying CoreDocument
.
Sourcepub fn properties(&self) -> &BTreeMap<String, Value>
pub fn properties(&self) -> &BTreeMap<String, Value>
Returns a reference to the custom DID Document properties.
Sourcepub fn properties_mut_unchecked(&mut self) -> &mut BTreeMap<String, Value>
pub fn properties_mut_unchecked(&mut self) -> &mut BTreeMap<String, Value>
Returns a mutable reference to the custom DID Document properties.
§Warning
The properties returned are not checked against the standard fields in a CoreDocument
. Incautious use can have
undesired consequences such as key collision when attempting to serialize the document or distinct resources (such
as services and methods) being identified by the same DID URL.
Sourcepub fn service(&self) -> &OrderedSet<Service>
pub fn service(&self) -> &OrderedSet<Service>
Return a set of all Service
s in the document.
Sourcepub fn remove_service(&mut self, did_url: &DIDUrl) -> Option<Service>
pub fn remove_service(&mut self, did_url: &DIDUrl) -> Option<Service>
Sourcepub fn methods(&self, scope: Option<MethodScope>) -> Vec<&VerificationMethod>
pub fn methods(&self, scope: Option<MethodScope>) -> Vec<&VerificationMethod>
Returns a Vec
of verification method references whose verification relationship matches scope
.
If scope
is None
, all embedded methods are returned.
Sourcepub fn insert_method(
&mut self,
method: VerificationMethod,
scope: MethodScope,
) -> Result<(), Error>
pub fn insert_method( &mut self, method: VerificationMethod, scope: MethodScope, ) -> Result<(), Error>
Adds a new VerificationMethod
to the document in the given MethodScope
.
§Errors
Returns an error if a method with the same fragment already exists.
Sourcepub fn remove_method(&mut self, did_url: &DIDUrl) -> Option<VerificationMethod>
pub fn remove_method(&mut self, did_url: &DIDUrl) -> Option<VerificationMethod>
Removes and returns the VerificationMethod
identified by did_url
from the document.
§Note
All references to the method found in the document will be removed. This includes cases where the reference is to a method contained in another DID document.
Sourcepub fn remove_method_and_scope(
&mut self,
did_url: &DIDUrl,
) -> Option<(VerificationMethod, MethodScope)>
pub fn remove_method_and_scope( &mut self, did_url: &DIDUrl, ) -> Option<(VerificationMethod, MethodScope)>
Removes and returns the VerificationMethod
from the document. The MethodScope
under which the method was
found is appended to the second position of the returned tuple.
§Note
All references to the method found in the document will be removed. This includes cases where the reference is to a method contained in another DID document.
Sourcepub fn attach_method_relationship<'query, Q>(
&mut self,
method_query: Q,
relationship: MethodRelationship,
) -> Result<bool, Error>where
Q: Into<DIDUrlQuery<'query>>,
pub fn attach_method_relationship<'query, Q>(
&mut self,
method_query: Q,
relationship: MethodRelationship,
) -> Result<bool, Error>where
Q: Into<DIDUrlQuery<'query>>,
Attaches the relationship to the method resolved by method_query
.
§Errors
Returns an error if the method does not exist or if it is embedded.
To convert an embedded method into a generic verification method, remove it first
and insert it with MethodScope::VerificationMethod
.
Sourcepub fn detach_method_relationship<'query, Q>(
&mut self,
method_query: Q,
relationship: MethodRelationship,
) -> Result<bool, Error>where
Q: Into<DIDUrlQuery<'query>>,
pub fn detach_method_relationship<'query, Q>(
&mut self,
method_query: Q,
relationship: MethodRelationship,
) -> Result<bool, Error>where
Q: Into<DIDUrlQuery<'query>>,
Detaches the relationship
from the method identified by did_url
.
Returns true
if the relationship was found and removed, false
otherwise.
§Errors
Returns an error if the method does not exist or is embedded.
To remove an embedded method, use Self::remove_method
.
§Note
If the method is referenced in the given scope, but the document does not contain the referenced verification method, then the reference will persist in the document (i.e. it is not removed).
Sourcepub fn resolve_method_mut<'query, Q>(
&mut self,
method_query: Q,
scope: Option<MethodScope>,
) -> Option<&mut VerificationMethod>where
Q: Into<DIDUrlQuery<'query>>,
pub fn resolve_method_mut<'query, Q>(
&mut self,
method_query: Q,
scope: Option<MethodScope>,
) -> Option<&mut VerificationMethod>where
Q: Into<DIDUrlQuery<'query>>,
Returns the first VerificationMethod
with an id
property matching the
provided method_query
and the verification relationship specified by scope
if present.
§Warning
Incorrect use of this method can lead to distinct document resources being identified by the same DID URL.
Sourcepub fn resolve_service<'query, 'me, Q>(
&'me self,
service_query: Q,
) -> Option<&'me Service>where
Q: Into<DIDUrlQuery<'query>>,
pub fn resolve_service<'query, 'me, Q>(
&'me self,
service_query: Q,
) -> Option<&'me Service>where
Q: Into<DIDUrlQuery<'query>>,
Returns the first Service
with an id
property matching the provided service_query
, if present.
Sourcepub fn resolve_method<'query, 'me, Q>(
&'me self,
method_query: Q,
scope: Option<MethodScope>,
) -> Option<&'me VerificationMethod>where
Q: Into<DIDUrlQuery<'query>>,
pub fn resolve_method<'query, 'me, Q>(
&'me self,
method_query: Q,
scope: Option<MethodScope>,
) -> Option<&'me VerificationMethod>where
Q: Into<DIDUrlQuery<'query>>,
Returns the first VerificationMethod
with an id
property matching the
provided method_query
and the verification relationship specified by scope
if present.
Sourcepub fn verify_jws<'jws, T>(
&self,
jws: &'jws Jws,
detached_payload: Option<&'jws [u8]>,
signature_verifier: &T,
options: &JwsVerificationOptions,
) -> Result<DecodedJws<'jws>, Error>where
T: JwsVerifier,
pub fn verify_jws<'jws, T>(
&self,
jws: &'jws Jws,
detached_payload: Option<&'jws [u8]>,
signature_verifier: &T,
options: &JwsVerificationOptions,
) -> Result<DecodedJws<'jws>, Error>where
T: JwsVerifier,
Decodes and verifies the provided JWS according to the passed JwsVerificationOptions
and
JwsVerifier
.
Regardless of which options are passed the following conditions must be met in order for a verification attempt to take place.
- The JWS must be encoded according to the JWS compact serialization.
- The
kid
value in the protected header must be an identifier of a verification method in this DID document.
Sourcepub fn pack(self) -> Result<Vec<u8>, Error>
pub fn pack(self) -> Result<Vec<u8>, Error>
Serializes the document storing it in an identity.
with the default StateMetadataEncoding
.
Sourcepub fn pack_with_encoding(
self,
encoding: StateMetadataEncoding,
) -> Result<Vec<u8>, Error>
pub fn pack_with_encoding( self, encoding: StateMetadataEncoding, ) -> Result<Vec<u8>, Error>
Serializes the document for storing it in an identity.
Source§impl IotaDocument
impl IotaDocument
Sourcepub fn unpack_from_iota_object_data(
did: &IotaDID,
data: &IotaObjectData,
allow_empty: bool,
) -> Result<IotaDocument, Error>
pub fn unpack_from_iota_object_data( did: &IotaDID, data: &IotaObjectData, allow_empty: bool, ) -> Result<IotaDocument, Error>
Deserializes the document from an IotaObjectData
instance.
If allow_empty
is true, this will return an empty DID document marked as deactivated
if state_metadata
is empty.
NOTE: did
is required since it is omitted from the serialized DID Document and
cannot be inferred from the state metadata. It also indicates the network, which is not
encoded in the object id alone.
Sourcepub fn from_iota_document_data(
data: &[u8],
allow_empty: bool,
did: &IotaDID,
alternative_did: Option<IotaDID>,
created: Timestamp,
updated: Timestamp,
) -> Result<IotaDocument, Error>
pub fn from_iota_document_data( data: &[u8], allow_empty: bool, did: &IotaDID, alternative_did: Option<IotaDID>, created: Timestamp, updated: Timestamp, ) -> Result<IotaDocument, Error>
Parse given Bytes into a IotaDocument
.
Requires a valid document in data
unless allow_empty
is true
, in which case
an empty, deactivated document is returned
§Errors:
- document related parsing Errors from
StateMetadataDocument::unpack
- possible parsing errors when trying to parse
created
andupdated
to aTimestamp
Source§impl IotaDocument
impl IotaDocument
Sourcepub fn revoke_credentials<'query, 'me, Q>(
&mut self,
service_query: Q,
indices: &[u32],
) -> Result<(), Error>where
Q: Into<DIDUrlQuery<'query>>,
pub fn revoke_credentials<'query, 'me, Q>(
&mut self,
service_query: Q,
indices: &[u32],
) -> Result<(), Error>where
Q: Into<DIDUrlQuery<'query>>,
If the document has a RevocationBitmap
service identified by service_query
, revoke all specified indices
.
Sourcepub fn unrevoke_credentials<'query, 'me, Q>(
&'me mut self,
service_query: Q,
indices: &[u32],
) -> Result<(), Error>where
Q: Into<DIDUrlQuery<'query>>,
pub fn unrevoke_credentials<'query, 'me, Q>(
&'me mut self,
service_query: Q,
indices: &[u32],
) -> Result<(), Error>where
Q: Into<DIDUrlQuery<'query>>,
If the document has a RevocationBitmap
service with an id by service_query
, unrevoke all specified indices
.
Trait Implementations§
Source§impl AsRef<CoreDocument> for IotaDocument
impl AsRef<CoreDocument> for IotaDocument
Source§fn as_ref(&self) -> &CoreDocument
fn as_ref(&self) -> &CoreDocument
Source§impl Clone for IotaDocument
impl Clone for IotaDocument
Source§fn clone(&self) -> IotaDocument
fn clone(&self) -> IotaDocument
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for IotaDocument
impl Debug for IotaDocument
Source§impl<'de> Deserialize<'de> for IotaDocument
impl<'de> Deserialize<'de> for IotaDocument
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<IotaDocument, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<IotaDocument, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Display for IotaDocument
impl Display for IotaDocument
Source§impl From<CoreDocument> for IotaDocument
impl From<CoreDocument> for IotaDocument
Source§fn from(value: CoreDocument) -> IotaDocument
fn from(value: CoreDocument) -> IotaDocument
Source§impl From<IotaDocument> for CoreDocument
impl From<IotaDocument> for CoreDocument
Source§fn from(document: IotaDocument) -> CoreDocument
fn from(document: IotaDocument) -> CoreDocument
Source§impl From<IotaDocument> for StateMetadataDocument
impl From<IotaDocument> for StateMetadataDocument
Source§fn from(document: IotaDocument) -> StateMetadataDocument
fn from(document: IotaDocument) -> StateMetadataDocument
Transforms a IotaDocument
into its state metadata representation by replacing all
occurrences of its did with a placeholder.
Source§impl JwkDocumentExt for IotaDocument
impl JwkDocumentExt for IotaDocument
Source§fn generate_method<'life0, 'life1, 'life2, 'async_trait, K, I>(
&'life0 mut self,
storage: &'life1 Storage<K, I>,
key_type: KeyType,
alg: JwsAlgorithm,
fragment: Option<&'life2 str>,
scope: MethodScope,
) -> Pin<Box<dyn Future<Output = Result<String, JwkStorageDocumentError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
K: JwkStorage + 'async_trait,
I: KeyIdStorage + 'async_trait,
IotaDocument: 'async_trait,
fn generate_method<'life0, 'life1, 'life2, 'async_trait, K, I>(
&'life0 mut self,
storage: &'life1 Storage<K, I>,
key_type: KeyType,
alg: JwsAlgorithm,
fragment: Option<&'life2 str>,
scope: MethodScope,
) -> Pin<Box<dyn Future<Output = Result<String, JwkStorageDocumentError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
K: JwkStorage + 'async_trait,
I: KeyIdStorage + 'async_trait,
IotaDocument: 'async_trait,
storage
and insert a new verification method with the corresponding
public key material into the DID document. Read moreSource§fn purge_method<'life0, 'life1, 'life2, 'async_trait, K, I>(
&'life0 mut self,
storage: &'life1 Storage<K, I>,
id: &'life2 DIDUrl,
) -> Pin<Box<dyn Future<Output = Result<(), JwkStorageDocumentError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
K: JwkStorage + 'async_trait,
I: KeyIdStorage + 'async_trait,
IotaDocument: 'async_trait,
fn purge_method<'life0, 'life1, 'life2, 'async_trait, K, I>(
&'life0 mut self,
storage: &'life1 Storage<K, I>,
id: &'life2 DIDUrl,
) -> Pin<Box<dyn Future<Output = Result<(), JwkStorageDocumentError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
K: JwkStorage + 'async_trait,
I: KeyIdStorage + 'async_trait,
IotaDocument: 'async_trait,
id
from the document and delete the corresponding key material in
the given storage
. Read moreSource§fn create_jws<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait, K, I>(
&'life0 self,
storage: &'life1 Storage<K, I>,
fragment: &'life2 str,
payload: &'life3 [u8],
options: &'life4 JwsSignatureOptions,
) -> Pin<Box<dyn Future<Output = Result<Jws, JwkStorageDocumentError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
K: JwkStorage + 'async_trait,
I: KeyIdStorage + 'async_trait,
IotaDocument: 'async_trait,
fn create_jws<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait, K, I>(
&'life0 self,
storage: &'life1 Storage<K, I>,
fragment: &'life2 str,
payload: &'life3 [u8],
options: &'life4 JwsSignatureOptions,
) -> Pin<Box<dyn Future<Output = Result<Jws, JwkStorageDocumentError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
K: JwkStorage + 'async_trait,
I: KeyIdStorage + 'async_trait,
IotaDocument: 'async_trait,
payload
according to options
with the storage backed private key corresponding to the
public key material in the verification method identified by the given `fragment. Read moreSource§fn create_credential_jwt<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait, K, I, T>(
&'life0 self,
credential: &'life1 Credential<T>,
storage: &'life2 Storage<K, I>,
fragment: &'life3 str,
options: &'life4 JwsSignatureOptions,
custom_claims: Option<BTreeMap<String, Value>>,
) -> Pin<Box<dyn Future<Output = Result<Jwt, JwkStorageDocumentError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
K: JwkStorage + 'async_trait,
I: KeyIdStorage + 'async_trait,
T: ToOwned<Owned = T> + Serialize + DeserializeOwned + Sync + 'async_trait,
IotaDocument: 'async_trait,
fn create_credential_jwt<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait, K, I, T>(
&'life0 self,
credential: &'life1 Credential<T>,
storage: &'life2 Storage<K, I>,
fragment: &'life3 str,
options: &'life4 JwsSignatureOptions,
custom_claims: Option<BTreeMap<String, Value>>,
) -> Pin<Box<dyn Future<Output = Result<Jwt, JwkStorageDocumentError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
K: JwkStorage + 'async_trait,
I: KeyIdStorage + 'async_trait,
T: ToOwned<Owned = T> + Serialize + DeserializeOwned + Sync + 'async_trait,
IotaDocument: 'async_trait,
credential
in accordance with VC Data Model v1.1. Read moreSource§fn create_presentation_jwt<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'async_trait, K, I, CRED, T>(
&'life0 self,
presentation: &'life1 Presentation<CRED, T>,
storage: &'life2 Storage<K, I>,
fragment: &'life3 str,
options: &'life4 JwsSignatureOptions,
jwt_options: &'life5 JwtPresentationOptions,
) -> Pin<Box<dyn Future<Output = Result<Jwt, JwkStorageDocumentError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
'life5: 'async_trait,
K: JwkStorage + 'async_trait,
I: KeyIdStorage + 'async_trait,
T: ToOwned<Owned = T> + Serialize + DeserializeOwned + Sync + 'async_trait,
CRED: ToOwned<Owned = CRED> + Serialize + DeserializeOwned + Clone + Sync + 'async_trait,
IotaDocument: 'async_trait,
fn create_presentation_jwt<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'async_trait, K, I, CRED, T>(
&'life0 self,
presentation: &'life1 Presentation<CRED, T>,
storage: &'life2 Storage<K, I>,
fragment: &'life3 str,
options: &'life4 JwsSignatureOptions,
jwt_options: &'life5 JwtPresentationOptions,
) -> Pin<Box<dyn Future<Output = Result<Jwt, JwkStorageDocumentError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
'life5: 'async_trait,
K: JwkStorage + 'async_trait,
I: KeyIdStorage + 'async_trait,
T: ToOwned<Owned = T> + Serialize + DeserializeOwned + Sync + 'async_trait,
CRED: ToOwned<Owned = CRED> + Serialize + DeserializeOwned + Clone + Sync + 'async_trait,
IotaDocument: 'async_trait,
presentation
in accordance with VC Data Model v1.1. Read moreSource§impl JwpDocumentExt for IotaDocument
impl JwpDocumentExt for IotaDocument
Source§fn generate_method_jwp<'life0, 'life1, 'life2, 'async_trait, K, I>(
&'life0 mut self,
storage: &'life1 Storage<K, I>,
key_type: KeyType,
alg: ProofAlgorithm,
fragment: Option<&'life2 str>,
scope: MethodScope,
) -> Pin<Box<dyn Future<Output = Result<String, JwkStorageDocumentError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
K: JwkStorageBbsPlusExt + 'async_trait,
I: KeyIdStorage + 'async_trait,
IotaDocument: 'async_trait,
fn generate_method_jwp<'life0, 'life1, 'life2, 'async_trait, K, I>(
&'life0 mut self,
storage: &'life1 Storage<K, I>,
key_type: KeyType,
alg: ProofAlgorithm,
fragment: Option<&'life2 str>,
scope: MethodScope,
) -> Pin<Box<dyn Future<Output = Result<String, JwkStorageDocumentError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
K: JwkStorageBbsPlusExt + 'async_trait,
I: KeyIdStorage + 'async_trait,
IotaDocument: 'async_trait,
storage
and insert a new verification method with the corresponding
public key material into the DID document. This supports BBS+ keys.Source§fn create_issued_jwp<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait, K, I>(
&'life0 self,
storage: &'life1 Storage<K, I>,
fragment: &'life2 str,
jpt_claims: &'life3 JptClaims,
options: &'life4 JwpCredentialOptions,
) -> Pin<Box<dyn Future<Output = Result<String, JwkStorageDocumentError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
K: JwkStorageBbsPlusExt + 'async_trait,
I: KeyIdStorage + 'async_trait,
IotaDocument: 'async_trait,
fn create_issued_jwp<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait, K, I>(
&'life0 self,
storage: &'life1 Storage<K, I>,
fragment: &'life2 str,
jpt_claims: &'life3 JptClaims,
options: &'life4 JwpCredentialOptions,
) -> Pin<Box<dyn Future<Output = Result<String, JwkStorageDocumentError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
K: JwkStorageBbsPlusExt + 'async_trait,
I: KeyIdStorage + 'async_trait,
IotaDocument: 'async_trait,
Source§fn create_presented_jwp<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
presentation: &'life1 mut SelectiveDisclosurePresentation,
method_id: &'life2 str,
options: &'life3 JwpPresentationOptions,
) -> Pin<Box<dyn Future<Output = Result<String, JwkStorageDocumentError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
IotaDocument: 'async_trait,
fn create_presented_jwp<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
presentation: &'life1 mut SelectiveDisclosurePresentation,
method_id: &'life2 str,
options: &'life3 JwpPresentationOptions,
) -> Pin<Box<dyn Future<Output = Result<String, JwkStorageDocumentError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
IotaDocument: 'async_trait,
Source§fn create_credential_jpt<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait, K, I, T>(
&'life0 self,
credential: &'life1 Credential<T>,
storage: &'life2 Storage<K, I>,
fragment: &'life3 str,
options: &'life4 JwpCredentialOptions,
custom_claims: Option<BTreeMap<String, Value>>,
) -> Pin<Box<dyn Future<Output = Result<Jpt, JwkStorageDocumentError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
K: JwkStorageBbsPlusExt + 'async_trait,
I: KeyIdStorage + 'async_trait,
T: ToOwned<Owned = T> + Serialize + DeserializeOwned + Sync + 'async_trait,
IotaDocument: 'async_trait,
fn create_credential_jpt<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait, K, I, T>(
&'life0 self,
credential: &'life1 Credential<T>,
storage: &'life2 Storage<K, I>,
fragment: &'life3 str,
options: &'life4 JwpCredentialOptions,
custom_claims: Option<BTreeMap<String, Value>>,
) -> Pin<Box<dyn Future<Output = Result<Jpt, JwkStorageDocumentError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
K: JwkStorageBbsPlusExt + 'async_trait,
I: KeyIdStorage + 'async_trait,
T: ToOwned<Owned = T> + Serialize + DeserializeOwned + Sync + 'async_trait,
IotaDocument: 'async_trait,
credential
.Source§fn create_presentation_jpt<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
presentation: &'life1 mut SelectiveDisclosurePresentation,
method_id: &'life2 str,
options: &'life3 JwpPresentationOptions,
) -> Pin<Box<dyn Future<Output = Result<Jpt, JwkStorageDocumentError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
IotaDocument: 'async_trait,
fn create_presentation_jpt<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
presentation: &'life1 mut SelectiveDisclosurePresentation,
method_id: &'life2 str,
options: &'life3 JwpPresentationOptions,
) -> Pin<Box<dyn Future<Output = Result<Jpt, JwkStorageDocumentError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
IotaDocument: 'async_trait,
credential
.Source§impl PartialEq for IotaDocument
impl PartialEq for IotaDocument
Source§impl Serialize for IotaDocument
impl Serialize for IotaDocument
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Source§impl TimeframeRevocationExtension for IotaDocument
impl TimeframeRevocationExtension for IotaDocument
Source§fn update<'life0, 'life1, 'life2, 'life3, 'async_trait, K, I>(
&'life0 self,
storage: &'life1 Storage<K, I>,
fragment: &'life2 str,
start_validity: Option<Timestamp>,
duration: Duration,
credential_jwp: &'life3 mut JwpIssued,
) -> Pin<Box<dyn Future<Output = Result<Jpt, JwkStorageDocumentError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
K: JwkStorageBbsPlusExt + 'async_trait,
I: KeyIdStorage + 'async_trait,
IotaDocument: 'async_trait,
fn update<'life0, 'life1, 'life2, 'life3, 'async_trait, K, I>(
&'life0 self,
storage: &'life1 Storage<K, I>,
fragment: &'life2 str,
start_validity: Option<Timestamp>,
duration: Duration,
credential_jwp: &'life3 mut JwpIssued,
) -> Pin<Box<dyn Future<Output = Result<Jpt, JwkStorageDocumentError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
K: JwkStorageBbsPlusExt + 'async_trait,
I: KeyIdStorage + 'async_trait,
IotaDocument: 'async_trait,
Source§impl TryFrom<(CoreDocument, IotaDocumentMetadata)> for IotaDocument
impl TryFrom<(CoreDocument, IotaDocumentMetadata)> for IotaDocument
Source§fn try_from(
value: (CoreDocument, IotaDocumentMetadata),
) -> Result<IotaDocument, <IotaDocument as TryFrom<(CoreDocument, IotaDocumentMetadata)>>::Error>
fn try_from( value: (CoreDocument, IotaDocumentMetadata), ) -> Result<IotaDocument, <IotaDocument as TryFrom<(CoreDocument, IotaDocumentMetadata)>>::Error>
Converts the tuple into an IotaDocument
if the given CoreDocument
has an identifier satisfying the
requirements of the IOTA UTXO method and the same holds for all of the CoreDocument's
controllers.
§Important
This does not check the relationship between the CoreDocument
and the IotaDocumentMetadata
.
Source§impl TryFrom<ProvisionalIotaDocument> for IotaDocument
impl TryFrom<ProvisionalIotaDocument> for IotaDocument
impl Eq for IotaDocument
impl StructuralPartialEq for IotaDocument
Auto Trait Implementations§
impl Freeze for IotaDocument
impl RefUnwindSafe for IotaDocument
impl Send for IotaDocument
impl Sync for IotaDocument
impl Unpin for IotaDocument
impl UnwindSafe for IotaDocument
Blanket Implementations§
§impl<U> As for U
impl<U> As for U
§fn as_<T>(self) -> Twhere
T: CastFrom<U>,
fn as_<T>(self) -> Twhere
T: CastFrom<U>,
self
to type T
. The semantics of numeric casting with the as
operator are followed, so <T as As>::as_::<U>
can be used in the same way as T as U
for numeric conversions. Read more§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Conv for T
impl<T> Conv for T
§impl<T> ConvertTo<T> for Twhere
T: Send,
impl<T> ConvertTo<T> for Twhere
T: Send,
fn convert(self) -> Result<T, Error>
fn convert_unchecked(self) -> T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
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
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> FmtForward for T
impl<T> FmtForward for T
§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self
to use its Binary
implementation when Debug
-formatted.§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self
to use its Display
implementation when
Debug
-formatted.§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self
to use its LowerExp
implementation when
Debug
-formatted.§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self
to use its LowerHex
implementation when
Debug
-formatted.§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self
to use its Octal
implementation when Debug
-formatted.§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self
to use its Pointer
implementation when
Debug
-formatted.§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self
to use its UpperExp
implementation when
Debug
-formatted.§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self
to use its UpperHex
implementation when
Debug
-formatted.§fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
Source§impl<T> FromJson for Twhere
T: for<'de> Deserialize<'de>,
impl<T> FromJson for Twhere
T: for<'de> Deserialize<'de>,
Source§fn from_json(json: &(impl AsRef<str> + ?Sized)) -> Result<Self, Error>
fn from_json(json: &(impl AsRef<str> + ?Sized)) -> Result<Self, Error>
Self
from a string of JSON text.Source§fn from_json_slice(json: &(impl AsRef<[u8]> + ?Sized)) -> Result<Self, Error>
fn from_json_slice(json: &(impl AsRef<[u8]> + ?Sized)) -> Result<Self, Error>
Self
from bytes of JSON text.Source§fn from_json_value(json: Value) -> Result<Self, Error>
fn from_json_value(json: Value) -> Result<Self, Error>
Self
from a serde_json::Value
.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a Request
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request
§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read more§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read more§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self
, then passes self.as_ref()
into the pipe function.§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self
, then passes self.as_mut()
into the pipe
function.§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self
, then passes self.deref()
into the pipe function.§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T> Tap for T
impl<T> Tap for T
§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B>
of a value. Read more§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B>
of a value. Read more§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R>
view of a value. Read more§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R>
view of a value. Read more§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target
of a value. Read more§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target
of a value. Read more§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap()
only in debug builds, and is erased in release builds.§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut()
only in debug builds, and is erased in release
builds.§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow()
only in debug builds, and is erased in release
builds.§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut()
only in debug builds, and is erased in release
builds.§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref()
only in debug builds, and is erased in release
builds.§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut()
only in debug builds, and is erased in release
builds.§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref()
only in debug builds, and is erased in release
builds.Source§impl<T> ToJson for Twhere
T: Serialize,
impl<T> ToJson for Twhere
T: Serialize,
Source§fn to_json_value(&self) -> Result<Value, Error>
fn to_json_value(&self) -> Result<Value, Error>
self
as a serde_json::Value
.§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string
, but without panic on OOM.