pub trait NetworkStatusProvider {
    // Required methods
    fn status<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Result<NetworkStatus, ()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn network_state<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Result<NetworkState, ()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Provides high-level status information about network.

Required Methods§

source

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

High-level network status information.

Returns an error if the NetworkWorker is no longer running.

source

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

Get the network state.

Returns an error if the NetworkWorker is no longer running.

Implementations on Foreign Types§

source§

impl<T> NetworkStatusProvider for Arc<T>

source§

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

source§

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

Implementors§

source§

impl<B, H> NetworkStatusProvider for NetworkService<B, H>
where B: BlockT + 'static, H: ExHashT,