fn take(&mut self, removed_addr: SocketAddr) -> Option<MetaAddr> {
        let _guard = self.span.enter();
        trace!(
            ?removed_addr,
            total_peers = self.by_addr.len(),
            recent_peers = self.recently_live_peers().count(),
        );

        if let Some(entry) = self.by_addr.remove(&removed_addr) {
            std::mem::drop(_guard);
            self.update_metrics();
            Some(entry)
        } else {
            None
        }
    }
/// Removes the entry with `addr`, returning it if it exists
///
/// ## Note
///
/// All changes should go through `update` or `take`, to ensure accurate metrics.
Removes the entry with `addr`, returning it if it exists
Removes the entry with ` addr ` returning it if it exists
fn take(&mut self, removed_addr: SocketAddr) -> Option<MetaAddr> {
        let _guard = self.span.enter();
        trace!(
            ?removed_addr,
            total_peers = self.by_addr.len(),
            recent_peers = self.recently_live_peers().count(),
        );
        if let Some(entry) = self.by_addr.remove(&removed_addr) {
            std::mem::drop(_guard);
            self.update_metrics();
            Some(entry)
        } else {
            None
        }
    }
fn take ( & mut self , removed_addr : SocketAddr ) -> Option < MetaAddr > { let _guard = self . span . enter ( ) ; trace ! ( removed_addr total_peers self by_addr len ( ) recent_peers self recently_live_peers ( ) count ( ) ) ; if let Some ( entry ) = self . by_addr . remove ( & removed_addr ) { std :: mem :: drop ( _guard ) ; self . update_metrics ( ) ; Some ( entry ) } else { None } }
Removes the entry with `addr`, returning it if it exists
Removes the entry with ` addr ` returning it if it exists
&mut self
removed_addr
SocketAddr
note
All changes should go through `update` or `take`, to ensure accurate metrics.
All changes should go through ` update ` or ` take ` to ensure accurate metrics .