reth::network

Trait 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> PeersInfo for &'a T
where T: 'a + PeersInfo + ?Sized, &'a T: Send + Sync,

Source§

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

Implementors§