[][src]Struct vade::plugin::rust_storage_cache::RustStorageCache

pub struct RustStorageCache { /* fields omitted */ }

in-memory storage

Methods

impl RustStorageCache[src]

pub fn new() -> RustStorageCache[src]

Creates new RustStorageCache instance

pub async fn get<'_, '_>(
    &'_ self,
    key: &'_ str
) -> Result<String, Box<dyn Error>>
[src]

Get value for given key from storage.

Arguments

  • key - id of value to fetch

pub async fn set<'_, '_, '_>(
    &'_ mut self,
    key: &'_ str,
    value: &'_ str
) -> Result<(), Box<dyn Error>>
[src]

Sets given value for given key.

Arguments

  • key - id of value to set
  • value - value to set

Trait Implementations

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

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

Auto Trait Implementations

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<T> From<T> for T[src]

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

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.