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§
Sourcefn local_addr(&self) -> SocketAddr
fn local_addr(&self) -> SocketAddr
Returns the SocketAddr
that listens for incoming connections.
Sourcefn network_status(
&self,
) -> impl Future<Output = Result<NetworkStatus, NetworkError>> + Send
fn network_status( &self, ) -> impl Future<Output = Result<NetworkStatus, NetworkError>> + Send
Returns the current status of the network being ran by the local node.
Sourcefn is_syncing(&self) -> bool
fn is_syncing(&self) -> bool
Returns true
if the network is undergoing sync.
Sourcefn is_initially_syncing(&self) -> bool
fn is_initially_syncing(&self) -> bool
Returns true
when the node is undergoing the very first Pipeline sync.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.