pub trait NetApi<N, T>: Send + Sync {
// Required methods
fn net_listening<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = TransportResult<bool>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn net_peer_count<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = TransportResult<u64>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn net_version<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = TransportResult<u64>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}
Available on crate feature
net-api
only.Expand description
Net namespace rpc interface that provides access to network information of the node.
Required Methods§
sourcefn net_listening<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = TransportResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn net_listening<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = TransportResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns a bool
indicating whether or not the node is listening for network connections.
sourcefn net_peer_count<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = TransportResult<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn net_peer_count<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = TransportResult<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns the number of peers connected to the node.
sourcefn net_version<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = TransportResult<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn net_version<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = TransportResult<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns the network ID (e.g. 1 for mainnet).