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
Auto Trait Implementations§
impl Freeze for NodeMap
impl RefUnwindSafe for NodeMap
impl Send for NodeMap
impl Sync for NodeMap
impl Unpin for NodeMap
impl UnwindSafe for NodeMap
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more