DbOperations

Trait DbOperations 

Source
pub trait DbOperations {
    type DbError: Error + Send + Sync + 'static;
    type ChainError: Error + Send + Sync + 'static;

    // Required methods
    fn find_surb<'life0, 'async_trait>(
        &'life0 self,
        matcher: SurbMatcher,
    ) -> Pin<Box<dyn Future<Output = Result<FoundSurb, Self::DbError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn resolve_chain_key<'life0, 'life1, 'async_trait>(
        &'life0 self,
        offchain_key: &'life1 OffchainPublicKey,
    ) -> Pin<Box<dyn Future<Output = Result<Option<Address>, Self::ChainError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

A common interface for wrapping caching operations needed by the probing mechanism.

This trait should eventually disappear as parts of this functionality move closer to the network layer.

Required Associated Types§

Source

type DbError: Error + Send + Sync + 'static

Source

type ChainError: Error + Send + Sync + 'static

Required Methods§

Source

fn find_surb<'life0, 'async_trait>( &'life0 self, matcher: SurbMatcher, ) -> Pin<Box<dyn Future<Output = Result<FoundSurb, Self::DbError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Attempts to find SURB and its ID given the SurbMatcher.

Source

fn resolve_chain_key<'life0, 'life1, 'async_trait>( &'life0 self, offchain_key: &'life1 OffchainPublicKey, ) -> Pin<Box<dyn Future<Output = Result<Option<Address>, Self::ChainError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Tries to resolve on-chain public key given the off-chain public key

Implementors§

Source§

impl<T, R> DbOperations for DbProxy<T, R>
where T: HoprDbProtocolOperations + Clone + Send + Sync + 'static, R: ChainKeyOperations + Clone + Send + Sync + 'static,

Source§

type ChainError = <R as ChainKeyOperations>::Error

Source§

type DbError = <T as HoprDbProtocolOperations>::Error