Trait NetworkStatus

Source
pub trait NetworkStatus {
    // Required methods
    fn local_peer_id(&self) -> PeerId;
    fn is_connected(&self, peer_id: &PeerId) -> bool;
}
Expand description

A trait for querying the peer ID and connectivity of the local node.

Required Methods§

Source

fn local_peer_id(&self) -> PeerId

Returns the peer ID of the local node.

Source

fn is_connected(&self, peer_id: &PeerId) -> bool

Returns true iff the local node is currently connected to the specified peer.

Implementors§