[][src]Struct didkit::Document

pub struct Document {
    pub context: Contexts,
    pub id: String,
    pub also_known_as: Option<Vec<String, Global>>,
    pub controller: Option<OneOrMany<String>>,
    pub verification_method: Option<Vec<VerificationMethod, Global>>,
    pub authentication: Option<Vec<VerificationMethod, Global>>,
    pub assertion_method: Option<Vec<VerificationMethod, Global>>,
    pub key_agreement: Option<Vec<VerificationMethod, Global>>,
    pub capability_invocation: Option<Vec<VerificationMethod, Global>>,
    pub capability_delegation: Option<Vec<VerificationMethod, Global>>,
    pub public_key: Option<Vec<VerificationMethod, Global>>,
    pub service: Option<Vec<Service, Global>>,
    pub proof: Option<OneOrMany<Proof>>,
    pub property_set: Option<BTreeMap<String, Value>>,
}

Fields

context: Contextsid: Stringalso_known_as: Option<Vec<String, Global>>controller: Option<OneOrMany<String>>verification_method: Option<Vec<VerificationMethod, Global>>authentication: Option<Vec<VerificationMethod, Global>>assertion_method: Option<Vec<VerificationMethod, Global>>key_agreement: Option<Vec<VerificationMethod, Global>>capability_invocation: Option<Vec<VerificationMethod, Global>>capability_delegation: Option<Vec<VerificationMethod, Global>>public_key: Option<Vec<VerificationMethod, Global>>service: Option<Vec<Service, Global>>proof: Option<OneOrMany<Proof>>property_set: Option<BTreeMap<String, Value>>

Implementations

impl Document[src]

pub fn new(id: &str) -> Document[src]

pub fn from_json(json: &str) -> Result<Document, Error>[src]

pub fn from_json_bytes(json: &[u8]) -> Result<Document, Error>[src]

pub fn select_object(&self, id: &DIDURL) -> Result<Resource, Error>[src]

Select an object in the DID document. For the DID URL dereferencing algorithm, Step 1.1

pub fn select_service(&self, fragment: &str) -> Option<&Service>[src]

Select a service endpoint object in the DID document. For the DID URL Dereferencing - Dereferencing the Primary Resource, Step 1.1

pub fn get_verification_method_ids(
    &self,
    verification_relationship: ProofPurpose
) -> Result<Vec<String, Global>, String>
[src]

Get verification method ids from a DID document, optionally limited to a specific verification relationship.

pub fn to_representation(
    &self,
    content_type: &str
) -> Result<Vec<u8, Global>, Error>
[src]

Trait Implementations

impl Clone for Document[src]

impl Debug for Document[src]

impl Default for Document[src]

impl<'de> Deserialize<'de> for Document[src]

impl PartialEq<Document> for Document[src]

impl Serialize for Document[src]

impl StructuralPartialEq for Document[src]

Auto Trait Implementations

impl RefUnwindSafe for Document[src]

impl Send for Document[src]

impl Sync for Document[src]

impl Unpin for Document[src]

impl UnwindSafe for Document[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<'a, T> Desc<'a, T> for T

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToOwned for T

type Owned = T

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,