Struct ssi_dids_core::document::Document
source · pub struct Document {
pub id: DIDBuf,
pub also_known_as: Vec<IriBuf>,
pub verification_relationships: VerificationRelationships,
pub controller: Option<OneOrMany<DIDBuf>>,
pub verification_method: Vec<DIDVerificationMethod>,
pub public_key: Vec<DIDVerificationMethod>,
pub service: Vec<Service>,
pub property_set: BTreeMap<String, Value>,
}
Expand description
Fields§
§id: DIDBuf
DID subject identifier.
also_known_as: Vec<IriBuf>
Other URIs for the DID subject.
verification_relationships: VerificationRelationships
Verification relationships.
Properties that express the relationship between the DID subject and a verification method using a verification relationship.
See: https://www.w3.org/TR/did-core/#verification-relationships
controller: Option<OneOrMany<DIDBuf>>
Controllers(s).
verification_method: Vec<DIDVerificationMethod>
verificationMethod
property of a
DID document, expressing verification
methods.
public_key: Vec<DIDVerificationMethod>
publicKey
property of a DID
document (deprecated in favor of verificationMethod
).
service: Vec<Service>
service
property of a DID document, expressing
services, generally as endpoints.
property_set: BTreeMap<String, Value>
Additional properties of a DID document. Some may be registered in DID Specification Registries.
Implementations§
source§impl Document
impl Document
sourcepub fn from_json_bytes(json: &[u8]) -> Result<Json, Error>
pub fn from_json_bytes(json: &[u8]) -> Result<Json, Error>
Construct a DID document from JSON bytes.
pub fn from_bytes( type_: MediaType, bytes: &[u8], ) -> Result<Represented, InvalidData>
sourcepub fn find_resource(&self, id: &DIDURL) -> Option<ResourceRef<'_>>
pub fn find_resource(&self, id: &DIDURL) -> Option<ResourceRef<'_>>
Select an object in the DID document.
See: https://w3c-ccg.github.io/did-resolution/#dereferencing-algorithm-secondary
sourcepub fn into_resource(self, id: &DIDURL) -> Option<Resource>
pub fn into_resource(self, id: &DIDURL) -> Option<Resource>
Select an object in the DID document.
See: https://w3c-ccg.github.io/did-resolution/#dereferencing-algorithm-secondary
sourcepub fn service(&self, id: &str) -> Option<&Service>
pub fn service(&self, id: &str) -> Option<&Service>
Returns the service with the given id
, if any.
pub fn into_representation(self, options: Options) -> Represented
sourcepub fn into_any_verification_method(self) -> Option<DIDVerificationMethod>
pub fn into_any_verification_method(self) -> Option<DIDVerificationMethod>
Consumes the document and returns any verification method in contains.
This will return the first verification method found, although users should not expect the DID documents to always list verification methods in the same order.
Trait Implementations§
source§impl Controller for Document
impl Controller for Document
source§fn allows_verification_method(
&self,
id: &Iri,
proof_purposes: ProofPurposes,
) -> bool
fn allows_verification_method( &self, id: &Iri, proof_purposes: ProofPurposes, ) -> bool
source§impl<'de> Deserialize<'de> for Document
impl<'de> Deserialize<'de> for Document
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>,
impl Eq for Document
impl StructuralPartialEq for Document
Auto Trait Implementations§
impl Freeze for Document
impl RefUnwindSafe for Document
impl Send for Document
impl Sync for Document
impl Unpin for Document
impl UnwindSafe for Document
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
source§impl<T> BorrowUnordered for T
impl<T> BorrowUnordered for T
fn as_unordered(&self) -> &Unordered<T>
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<'de, T, C> DeserializeTyped<'de, C> for Twhere
T: Deserialize<'de>,
impl<'de, T, C> DeserializeTyped<'de, C> for Twhere
T: Deserialize<'de>,
fn deserialize_typed<S>(
_: &C,
deserializer: S,
) -> Result<T, <S as Deserializer<'de>>::Error>where
S: Deserializer<'de>,
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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.source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
fn equivalent(&self, key: &K) -> bool
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T, U, C> IntoWithContext<U, C> for Twhere
U: FromWithContext<T, C>,
impl<T, U, C> IntoWithContext<U, C> for Twhere
U: FromWithContext<T, C>,
source§impl<T> ResourceProvider<()> for T
impl<T> ResourceProvider<()> for T
source§fn get_resource(&self) -> &()
fn get_resource(&self) -> &()
T
.