Trait reth_network_api::PeersInfo

source ·
pub trait PeersInfo: Send + Sync {
    // Required methods
    fn num_connected_peers(&self) -> usize;
    fn local_node_record(&self) -> NodeRecord;
    fn local_enr(&self) -> Enr<SecretKey>;
}
Expand description

Provides general purpose information about Peers in the network.

Required Methods§

source

fn num_connected_peers(&self) -> usize

Returns how many peers the network is currently connected to.

Note: this should only include established connections and not ongoing attempts.

source

fn local_node_record(&self) -> NodeRecord

Returns the Ethereum Node Record of the node.

source

fn local_enr(&self) -> Enr<SecretKey>

Returns the local ENR of the node.

Implementations on Foreign Types§

source§

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

source§

fn num_connected_peers(&self) -> usize

source§

fn local_node_record(&self) -> NodeRecord

source§

fn local_enr(&self) -> Enr<SecretKey>

source§

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

source§

fn num_connected_peers(&self) -> usize

source§

fn local_node_record(&self) -> NodeRecord

source§

fn local_enr(&self) -> Enr<SecretKey>

Implementors§