reth_network

Trait PeersInfo

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§

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.

fn local_node_record(&self) -> NodeRecord

Returns the Ethereum Node Record of the node.

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

Returns the local ENR of the node.

Implementations on Foreign Types§

§

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

§

fn num_connected_peers(&self) -> usize

§

fn local_node_record(&self) -> NodeRecord

§

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

§

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

§

fn num_connected_peers(&self) -> usize

§

fn local_node_record(&self) -> NodeRecord

§

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

Implementors§

§

impl PeersInfo for NoopNetwork

Source§

impl<N: NetworkPrimitives> PeersInfo for NetworkHandle<N>