Trait reth_network_api::NetworkInfo

source ·
pub trait NetworkInfo: Send + Sync {
    // Required methods
    fn local_addr(&self) -> SocketAddr;
    fn network_status(
        &self,
    ) -> impl Future<Output = Result<NetworkStatus, NetworkError>> + Send;
    fn chain_id(&self) -> u64;
    fn is_syncing(&self) -> bool;
    fn is_initially_syncing(&self) -> bool;
}
Expand description

Provides general purpose information about the network.

Required Methods§

source

fn local_addr(&self) -> SocketAddr

Returns the SocketAddr that listens for incoming connections.

source

fn network_status( &self, ) -> impl Future<Output = Result<NetworkStatus, NetworkError>> + Send

Returns the current status of the network being ran by the local node.

source

fn chain_id(&self) -> u64

Returns the chain id

source

fn is_syncing(&self) -> bool

Returns true if the network is undergoing sync.

source

fn is_initially_syncing(&self) -> bool

Returns true when the node is undergoing the very first Pipeline sync.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<'a, T: 'a + NetworkInfo + ?Sized> NetworkInfo for &'a T
where &'a T: Send + Sync,

source§

impl<T: NetworkInfo + ?Sized> NetworkInfo for Arc<T>
where Arc<T>: Send + Sync,

Implementors§