pub fn remove_connection(&mut self, peer: PeerId, connection: &ConnectionId) -> Option<PendingResponses> {
        self.established
            .entry(peer)
            .and_modify(|established| established.connections.retain(|id, _| id != connection));
        if let Some(true) = self
            .established
            .get(&peer)
            .map(|established| established.connections.is_empty())
        {
            self.established.remove(&peer);
        }
        self.pending_responses.remove(connection)
    }
// Remove a connection from the list, return the pending responses on that connection.
Remove a connection from the list, return the pending responses on that connection.
Remove a connection from the list return the pending responses on that connection .
pub fn remove_connection(&mut self, peer: PeerId, connection: &ConnectionId) -> Option<PendingResponses> {
        self.established
            .entry(peer)
            .and_modify(|established| established.connections.retain(|id, _| id != connection));
        if let Some(true) = self
            .established
            .get(&peer)
            .map(|established| established.connections.is_empty())
        {
            self.established.remove(&peer);
        }
        self.pending_responses.remove(connection)
    }
pub fn remove_connection ( & mut self , peer : PeerId , connection : & ConnectionId ) -> Option < PendingResponses > { self . established . entry ( peer ) . and_modify ( | established | established . connections . retain ( | id , _ | id != connection ) ) ; if let Some ( true ) = self . established . get ( & peer ) . map ( | established | established . connections . is_empty ( ) ) { self . established . remove ( & peer ) ; } self . pending_responses . remove ( connection ) }
Remove a connection from the list, return the pending responses on that connection.
Remove a connection from the list return the pending responses on that connection .
&mut self
peer
PeerId
connection
&ConnectionId
&mut self
peer
PeerId
connection
&ConnectionId