pub(crate) fn learn_addr(
        &mut self,
        addr: SocketAddr,
        unforgettable: bool,
        now: Instant,
    ) -> Option<DialRequest<H>> {
        let span = make_span(addr, self.outgoing.get(&addr));
        span.clone()
            .in_scope(move || match self.outgoing.entry(addr) {
                Entry::Occupied(_) => {
                    debug!("ignoring already known address");
                    None
                }
                Entry::Vacant(_vacant) => {
                    info!("connecting to newly learned address");
                    let outgoing = self.change_outgoing_state(
                        addr,
                        OutgoingState::Connecting {
                            failures_so_far: 0,
                            since: now,
                        },
                    );
                    if outgoing.is_unforgettable != unforgettable {
                        outgoing.is_unforgettable = unforgettable;
                        debug!(unforgettable, "marked");
                    }
                    Some(DialRequest::Dial { addr, span })
                }
            })
    }
/// Notify about a potentially new address that has been discovered.
///
/// Immediately triggers the connection process to said address if it was not known before.
///
/// A connection marked `unforgettable` will never be evicted but reset instead when it exceeds
/// the retry limit.
Notify about a potentially new address that has been discovered.
Immediately triggers the connection process to said address if it was not known before.

A connection marked `unforgettable` will never be evicted but reset instead when it exceeds
the retry limit.
Notify about a potentially new address that has been discovered . Immediately triggers the connection process to said address if it was not known before . A connection marked ` unforgettable ` will never be evicted but reset instead when it exceeds the retry limit .
pub(crate) fn learn_addr(
        &mut self,
        addr: SocketAddr,
        unforgettable: bool,
        now: Instant,
    ) -> Option<DialRequest<H>> {
        let span = make_span(addr, self.outgoing.get(&addr));
        span.clone()
            .in_scope(move || match self.outgoing.entry(addr) {
                Entry::Occupied(_) => {
                    debug!("ignoring already known address");
                    None
                }
                Entry::Vacant(_vacant) => {
                    info!("connecting to newly learned address");
                    let outgoing = self.change_outgoing_state(
                        addr,
                        OutgoingState::Connecting {
                            failures_so_far: 0,
                            since: now,
                        },
                    );
                    if outgoing.is_unforgettable != unforgettable {
                        outgoing.is_unforgettable = unforgettable;
                        debug!(unforgettable, "marked");
                    }
                    Some(DialRequest::Dial { addr, span })
                }
            })
    }
pub ( crate ) fn learn_addr ( & mut self , addr : SocketAddr , unforgettable : bool , now : Instant , ) -> Option < DialRequest < H > > { let span = make_span ( addr , self . outgoing . get ( & addr ) ) ; span . clone ( ) . in_scope ( move | | match self . outgoing . entry ( addr ) { Entry :: Occupied ( _ ) => { debug ! ( " " ) ; None } Entry :: Vacant ( _vacant ) => { info ! ( " " ) ; let outgoing = self . change_outgoing_state ( addr , OutgoingState :: Connecting { failures_so_far : 0 , since : now , } , ) ; if outgoing . is_unforgettable != unforgettable { outgoing . is_unforgettable = unforgettable ; debug ! ( unforgettable " " ) ; } Some ( DialRequest :: Dial { addr , span } ) } } ) }
Notify about a potentially new address that has been discovered.
Notify about a potentially new address that has been discovered .
&mut self
addr
SocketAddr
unforgettable
bool
now
Instant
&mut self
addr
SocketAddr
unforgettable
bool
now
Instant