Struct grapevine::connection::NodeMap
source · pub struct NodeMap { /* private fields */ }
Expand description
Structure of the map of peers in the network
Implementations§
source§impl NodeMap
impl NodeMap
sourcepub fn new(self_pub_addr: SocketAddr) -> Self
pub fn new(self_pub_addr: SocketAddr) -> Self
Creates a new NodeMap
sourcepub fn add_old_one(&mut self, endpoint: Endpoint)
pub fn add_old_one(&mut self, endpoint: Endpoint)
Adds an old info on the node
sourcepub fn add_new_one(&mut self, endpoint: Endpoint, pub_addr: SocketAddr)
pub fn add_new_one(&mut self, endpoint: Endpoint, pub_addr: SocketAddr)
Adds a new info on the node
sourcepub fn get_peers_list(&self) -> Vec<SocketAddr>
pub fn get_peers_list(&self) -> Vec<SocketAddr>
Retrieves the list of peers in the network
sourcepub fn fetch_receivers(&self) -> Vec<NodeAddr>
pub fn fetch_receivers(&self) -> Vec<NodeAddr>
Retrieves peer addresses
sourcepub fn get_pub_addr(&self, endpoint: &Endpoint) -> Option<SocketAddr>
pub fn get_pub_addr(&self, endpoint: &Endpoint) -> Option<SocketAddr>
Retrieves the public address of the node