mithril_client::certificate_client

Trait CertificateVerifierCache

source
pub trait CertificateVerifierCache: Sync + Send {
    // Required methods
    fn store_validated_certificate<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        certificate_hash: &'life1 str,
        previous_certificate_hash: &'life2 str,
    ) -> Pin<Box<dyn Future<Output = MithrilResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn get_previous_hash<'life0, 'life1, 'async_trait>(
        &'life0 self,
        certificate_hash: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = MithrilResult<Option<String>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn reset<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = MithrilResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

API that defines how to cache certificates validation results.

Required Methods§

source

fn store_validated_certificate<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, certificate_hash: &'life1 str, previous_certificate_hash: &'life2 str, ) -> Pin<Box<dyn Future<Output = MithrilResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Store a validated certificate hash and its parent hash in the cache.

source

fn get_previous_hash<'life0, 'life1, 'async_trait>( &'life0 self, certificate_hash: &'life1 str, ) -> Pin<Box<dyn Future<Output = MithrilResult<Option<String>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get the previous hash of the certificate with the given hash if available in the cache.

source

fn reset<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = MithrilResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Reset the stored values

Implementors§