Skip to main content

PeersInfo

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.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

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§

Source§

impl<Net> PeersInfo for NoopNetwork<Net>
where Net: Send + Sync,