/// Generate an address at which a server configured with this
/// GossipListenAddr can communicate with itself.
///
/// In particular, a server configured to listen on `0.0.0.0` vs
/// `192.168.1.1` should be contacted via `127.0.0.1` in the
/// former case, but `192.168.1.1` in the latter.
Generate an address at which a server configured with this
GossipListenAddr can communicate with itself.


Generate an address at which a server configured with this GossipListenAddr can communicate with itself .
pub fn local_addr(&self) -> Self {
        let mut addr = *self;
        if addr.0.ip().is_unspecified() {
            // TODO (CM): Use Ipv4Addr::loopback() when it's no longer experimental
            // TODO (CM): Support IPV6, once we do that more broadly
            addr.0.set_ip(IpAddr::V4(Ipv4Addr::new(127, 0, 0, 1)));
        }
        addr
    }
pub fn local_addr ( & self ) -> Self { let mut addr = * self ; if addr . 0 . ip ( ) . is_unspecified ( ) { // TODO (CM): Use Ipv4Addr::loopback() when it's no longer experimental // TODO (CM): Support IPV6, once we do that more broadly addr . 0 . set_ip ( IpAddr :: V4 ( Ipv4Addr :: new ( 127 , 0 , 0 , 1 ) ) ) ; } addr }
Generate an address at which a server configured with this
GossipListenAddr can communicate with itself.
Generate an address at which a server configured with this GossipListenAddr can communicate with itself .
&self