pub(super) fn remove_incoming(&mut self, peer_addr: SocketAddr, now: Instant) -> bool {
        match self {
            ConnectionSymmetry::IncomingOnly { peer_addrs, .. } => {
                // Remove the incoming connection, warn if it didn't exist.
                if !peer_addrs.remove(&peer_addr) {
                    warn!("tried to remove non-existent incoming connection from symmetry");
                }

                // Indicate removal if this was the last incoming connection.
                if peer_addrs.is_empty() {
                    *self = ConnectionSymmetry::Gone;
                    debug!("removed incoming connection, now gone");

                    false
                } else {
                    debug!(
                        total_incoming_count = peer_addrs.len(),
                        "removed incoming connection, still has remaining incoming"
                    );

                    true
                }
            }
            ConnectionSymmetry::OutgoingOnly { .. } => {
                warn!("cannot remove incoming connection from outgoing-only");
                true
            }
            ConnectionSymmetry::Symmetric { peer_addrs } => {
                if !peer_addrs.remove(&peer_addr) {
                    warn!("tried to remove non-existent symmetric connection from symmetry");
                }
                if peer_addrs.is_empty() {
                    *self = ConnectionSymmetry::OutgoingOnly { since: now };
                    debug!("removed incoming connection, now incoming-only");
                }
                true
            }
            ConnectionSymmetry::Gone => {
                // This is just an error.
                warn!("removing incoming connection from already gone symmetry");
                false
            }
        }
    }
/// An incoming address has been removed.
///
/// Returns `false` if the `ConnectionSymmetry` should be removed after this.
An incoming address has been removed.
Returns `false` if the `ConnectionSymmetry` should be removed after this.
An incoming address has been removed . Returns ` false ` if the ` ConnectionSymmetry ` should be removed after this .
pub(super) fn remove_incoming(&mut self, peer_addr: SocketAddr, now: Instant) -> bool {
        match self {
            ConnectionSymmetry::IncomingOnly { peer_addrs, .. } => {
                // Remove the incoming connection, warn if it didn't exist.
                if !peer_addrs.remove(&peer_addr) {
                    warn!("tried to remove non-existent incoming connection from symmetry");
                }
                // Indicate removal if this was the last incoming connection.
                if peer_addrs.is_empty() {
                    *self = ConnectionSymmetry::Gone;
                    debug!("removed incoming connection, now gone");
                    false
                } else {
                    debug!(
                        total_incoming_count = peer_addrs.len(),
                        "removed incoming connection, still has remaining incoming"
                    );
                    true
                }
            }
            ConnectionSymmetry::OutgoingOnly { .. } => {
                warn!("cannot remove incoming connection from outgoing-only");
                true
            }
            ConnectionSymmetry::Symmetric { peer_addrs } => {
                if !peer_addrs.remove(&peer_addr) {
                    warn!("tried to remove non-existent symmetric connection from symmetry");
                }
                if peer_addrs.is_empty() {
                    *self = ConnectionSymmetry::OutgoingOnly { since: now };
                    debug!("removed incoming connection, now incoming-only");
                }
                true
            }
            ConnectionSymmetry::Gone => {
                // This is just an error.
                warn!("removing incoming connection from already gone symmetry");
                false
            }
        }
    }
pub ( super ) fn remove_incoming ( & mut self , peer_addr : SocketAddr , now : Instant ) -> bool { match self { ConnectionSymmetry :: IncomingOnly { peer_addrs , .. } => { // Remove the incoming connection, warn if it didn't exist. if ! peer_addrs . remove ( & peer_addr ) { warn ! ( " " ) ; } // Indicate removal if this was the last incoming connection. if peer_addrs . is_empty ( ) { * self = ConnectionSymmetry :: Gone ; debug ! ( " " ) ; false } else { debug ! ( total_incoming_count peer_addrs len ( ) " " ) ; true } } ConnectionSymmetry :: OutgoingOnly { .. } => { warn ! ( " " ) ; true } ConnectionSymmetry :: Symmetric { peer_addrs } => { if ! peer_addrs . remove ( & peer_addr ) { warn ! ( " " ) ; } if peer_addrs . is_empty ( ) { * self = ConnectionSymmetry :: OutgoingOnly { since : now } ; debug ! ( " " ) ; } true } ConnectionSymmetry :: Gone => { // This is just an error. warn ! ( " " ) ; false } } }
An incoming address has been removed.
An incoming address has been removed .
&mut self
peer_addr
SocketAddr
now
Instant
&mut self
peer_addr
SocketAddr
now
Instant