[][src]Trait vade::traits::VcResolver

pub trait VcResolver: Send + Sync {
#[must_use]    fn check_vc<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        vc_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
;
#[must_use] fn get_vc_document<'life0, 'life1, 'async_trait>(
        &'life0 self,
        vd_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
;
#[must_use] fn set_vc_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 vc documents by their id.

Required methods

#[must_use]fn check_vc<'life0, 'life1, 'life2, 'async_trait>(
    &'life0 self,
    vc_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, 

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

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

Arguments

  • vc_id - vc_id to check document for
  • value - value to check

#[must_use]fn get_vc_document<'life0, 'life1, 'async_trait>(
    &'life0 self,
    vd_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, 

Gets document for given vc name.

Arguments

  • vc_name - vc_name to fetch

#[must_use]fn set_vc_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 vc name.

Arguments

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

Implementors

impl VcResolver for RustStorageCache[src]

fn check_vc<'life0, 'life1, 'life2, 'async_trait>(
    &'life0 self,
    vc_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]

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

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

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

Arguments

  • vc_id - vc_id to check document for
  • value - value to check

fn get_vc_document<'life0, 'life1, 'async_trait>(
    &'life0 self,
    vc_name: &'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 vc.

Arguments

  • vc_name - vc_name to fetch

fn set_vc_document<'life0, 'life1, 'life2, 'async_trait>(
    &'life0 mut self,
    vc_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]

Sets document for given vc name.

Arguments

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