web5_rust::dids

Trait DidDocument

Source
pub trait DidDocument:
    DynClone
    + Debug
    + Sync
    + Send
    + Serialize
    + Deserialize {
    // Required methods
    fn method(&self) -> DidMethod;
    fn id(&self) -> String;
    fn keys(&self) -> Vec<&DidKey>;
    fn services(&self) -> Vec<&DidService>;
    fn get_key(&self, id: &str) -> Option<&DidKey>;
    fn get_service(&self, id: &str) -> Option<&DidService>;
    fn resolve<'life0, 'async_trait>(
        id: &'life0 str,
    ) -> Pin<Box<dyn Future<Output = Result<Option<Self>, Error>> + Send + 'async_trait>>
       where Self: Sized + 'async_trait,
             'life0: 'async_trait;

    // Provided method
    fn did(&self) -> Did { ... }
}

Required Methods§

Source

fn method(&self) -> DidMethod

Source

fn id(&self) -> String

Source

fn keys(&self) -> Vec<&DidKey>

Source

fn services(&self) -> Vec<&DidService>

Source

fn get_key(&self, id: &str) -> Option<&DidKey>

Source

fn get_service(&self, id: &str) -> Option<&DidService>

Source

fn resolve<'life0, 'async_trait>( id: &'life0 str, ) -> Pin<Box<dyn Future<Output = Result<Option<Self>, Error>> + Send + 'async_trait>>
where Self: Sized + 'async_trait, 'life0: 'async_trait,

Provided Methods§

Source

fn did(&self) -> Did

Trait Implementations§

Source§

impl<'typetag> Serialize for dyn DidDocument + 'typetag

Source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<'typetag> Serialize for dyn DidDocument + Send + 'typetag

Source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<'typetag> Serialize for dyn DidDocument + Send + Sync + 'typetag

Source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<'typetag> Serialize for dyn DidDocument + Sync + 'typetag

Source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more

Implementors§