[][src]Trait vade::traits::DidResolver

pub trait DidResolver: Send + Sync {
#[must_use]    fn check_did<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        did_name: &'life1 str,
        value: &'life2 str
    ) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error>>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        'life2: 'async_trait,
        Self: 'async_trait
;
#[must_use] fn get_did_document<'life0, 'life1, 'async_trait>(
        &'life0 self,
        key: &'life1 str
    ) -> Pin<Box<dyn Future<Output = Result<String, Box<dyn Error>>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
;
#[must_use] fn set_did_document<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 mut self,
        key: &'life1 str,
        value: &'life2 str
    ) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error>>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        'life2: 'async_trait,
        Self: 'async_trait
; }

Implementing struct supports fetching did documents by their id.

Required methods

#[must_use]fn check_did<'life0, 'life1, 'life2, 'async_trait>(
    &'life0 self,
    did_name: &'life1 str,
    value: &'life2 str
) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error>>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    'life2: 'async_trait,
    Self: 'async_trait, 

Checks given DID document. A DID document is considered as valid if returning (). Resolver may throw to indicate

  • that it is not responsible for this DID
  • that it considers this DID as invalid

Arguments

  • did_name - did_name to check document for
  • value - value to check

#[must_use]fn get_did_document<'life0, 'life1, 'async_trait>(
    &'life0 self,
    key: &'life1 str
) -> Pin<Box<dyn Future<Output = Result<String, Box<dyn Error>>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 

Gets document for given did name.

Arguments

  • did_name - did_name to fetch

#[must_use]fn set_did_document<'life0, 'life1, 'life2, 'async_trait>(
    &'life0 mut self,
    key: &'life1 str,
    value: &'life2 str
) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error>>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    'life2: 'async_trait,
    Self: 'async_trait, 

Sets document for given did name.

Arguments

  • did_name - did_name to set value for
  • value - value to set
Loading content...

Implementors

impl DidResolver for RustStorageCache[src]

fn check_did<'life0, 'life1, 'life2, 'async_trait>(
    &'life0 self,
    did_name: &'life1 str,
    _value: &'life2 str
) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error>>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    'life2: 'async_trait,
    Self: 'async_trait, 
[src]

Checks given DID document. A DID document is considered as valid if returning (). Resolver may throw to indicate

  • that it is not responsible for this DID
  • that it considers this DID as invalid

Currently the test did_name "test" is accepted as valid.

Arguments

  • did_name - did_name to check document for
  • value - value to check

fn get_did_document<'life0, 'life1, 'async_trait>(
    &'life0 self,
    did_id: &'life1 str
) -> Pin<Box<dyn Future<Output = Result<String, Box<dyn Error>>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 
[src]

Gets document for given did name.

Arguments

  • did_name - did_name to fetch

fn set_did_document<'life0, 'life1, 'life2, 'async_trait>(
    &'life0 mut self,
    did_id: &'life1 str,
    value: &'life2 str
) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error>>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    'life2: 'async_trait,
    Self: 'async_trait, 
[src]

Sets document for given did name.

Arguments

  • did_name - did_name to set value for
  • value - value to set
Loading content...