pub trait AuthorityDiscovery: Send + Debug + 'static {
    // Required methods
    fn get_addresses_by_authority_id<'life0, 'async_trait>(
        &'life0 mut self,
        authority: AuthorityDiscoveryId
    ) -> Pin<Box<dyn Future<Output = Option<HashSet<Multiaddr>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_authority_ids_by_peer_id<'life0, 'async_trait>(
        &'life0 mut self,
        peer_id: PeerId
    ) -> Pin<Box<dyn Future<Output = Option<HashSet<AuthorityDiscoveryId>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

An abstraction over the authority discovery service.

Needed for mocking in tests mostly.

Required Methods§

source

fn get_addresses_by_authority_id<'life0, 'async_trait>( &'life0 mut self, authority: AuthorityDiscoveryId ) -> Pin<Box<dyn Future<Output = Option<HashSet<Multiaddr>>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Get the addresses for the given [AuthorityId] from the local address cache.

source

fn get_authority_ids_by_peer_id<'life0, 'async_trait>( &'life0 mut self, peer_id: PeerId ) -> Pin<Box<dyn Future<Output = Option<HashSet<AuthorityDiscoveryId>>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Get the [AuthorityId] for the given PeerId from the local address cache.

Implementations on Foreign Types§

source§

impl AuthorityDiscovery for AuthorityDiscoveryService

source§

fn get_addresses_by_authority_id<'life0, 'async_trait>( &'life0 mut self, authority: AuthorityDiscoveryId ) -> Pin<Box<dyn Future<Output = Option<HashSet<Multiaddr>>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

source§

fn get_authority_ids_by_peer_id<'life0, 'async_trait>( &'life0 mut self, peer_id: PeerId ) -> Pin<Box<dyn Future<Output = Option<HashSet<AuthorityDiscoveryId>>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Implementors§