Trait DbOperations

Source
pub trait DbOperations {
    // Required methods
    fn find_surb<'life0, 'async_trait>(
        &'life0 self,
        matcher: SurbMatcher,
    ) -> Pin<Box<dyn Future<Output = Result<(HoprSenderId, HoprSurb)>> + 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>>> + 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 Methods§

Source

fn find_surb<'life0, 'async_trait>( &'life0 self, matcher: SurbMatcher, ) -> Pin<Box<dyn Future<Output = Result<(HoprSenderId, HoprSurb)>> + 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>>> + 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> DbOperations for DbProxy<T>
where T: HoprDbResolverOperations + HoprDbProtocolOperations + Debug + Clone + Send + Sync + 'static,