fn poll_unready(&mut self, cx: &mut Context<'_>) {
        loop {
            match Pin::new(&mut self.unready_services).poll_next(cx) {
                // No unready service changes, or empty unready services
                Poll::Pending | Poll::Ready(None) => return,

                // Unready -> Ready
                Poll::Ready(Some(Ok((key, svc)))) => {
                    trace!(?key, "service became ready");
                    let cancel = self.cancel_handles.remove(&key);
                    assert!(cancel.is_some(), "missing cancel handle");

                    if svc.version() >= self.minimum_peer_version.current() {
                        self.ready_services.insert(key, svc);
                    }
                }

                // Unready -> Canceled
                Poll::Ready(Some(Err((key, UnreadyError::Canceled)))) => {
                    // A service be canceled because we've connected to the same service twice.
                    // In that case, there is a cancel handle for the peer address,
                    // but it belongs to the service for the newer connection.
                    trace!(
                        ?key,
                        duplicate_connection = self.cancel_handles.contains_key(&key),
                        "service was canceled, dropping service"
                    );
                }
                Poll::Ready(Some(Err((key, UnreadyError::CancelHandleDropped(_))))) => {
                    // Similarly, services with dropped cancel handes can have duplicates.
                    trace!(
                        ?key,
                        duplicate_connection = self.cancel_handles.contains_key(&key),
                        "cancel handle was dropped, dropping service"
                    );
                }

                // Unready -> Errored
                Poll::Ready(Some(Err((key, UnreadyError::Inner(error))))) => {
                    debug!(%error, "service failed while unready, dropping service");

                    let cancel = self.cancel_handles.remove(&key);
                    assert!(cancel.is_some(), "missing cancel handle");
                }
            }
        }
    }
/// Check busy peer services for request completion or errors.
///
/// Move newly ready services to the ready list if they are for peers with supported protocol
/// versions, otherwise they are dropped. Also drop failed services.
Check busy peer services for request completion or errors.
Move newly ready services to the ready list if they are for peers with supported protocol
versions, otherwise they are dropped. Also drop failed services.
Check busy peer services for request completion or errors . Move newly ready services to the ready list if they are for peers with supported protocol versions otherwise they are dropped . Also drop failed services .
fn poll_unready(&mut self, cx: &mut Context<'_>) {
        loop {
            match Pin::new(&mut self.unready_services).poll_next(cx) {
                // No unready service changes, or empty unready services
                Poll::Pending | Poll::Ready(None) => return,
                // Unready -> Ready
                Poll::Ready(Some(Ok((key, svc)))) => {
                    trace!(?key, "service became ready");
                    let cancel = self.cancel_handles.remove(&key);
                    assert!(cancel.is_some(), "missing cancel handle");
                    if svc.version() >= self.minimum_peer_version.current() {
                        self.ready_services.insert(key, svc);
                    }
                }
                // Unready -> Canceled
                Poll::Ready(Some(Err((key, UnreadyError::Canceled)))) => {
                    // A service be canceled because we've connected to the same service twice.
                    // In that case, there is a cancel handle for the peer address,
                    // but it belongs to the service for the newer connection.
                    trace!(
                        ?key,
                        duplicate_connection = self.cancel_handles.contains_key(&key),
                        "service was canceled, dropping service"
                    );
                }
                Poll::Ready(Some(Err((key, UnreadyError::CancelHandleDropped(_))))) => {
                    // Similarly, services with dropped cancel handes can have duplicates.
                    trace!(
                        ?key,
                        duplicate_connection = self.cancel_handles.contains_key(&key),
                        "cancel handle was dropped, dropping service"
                    );
                }
                // Unready -> Errored
                Poll::Ready(Some(Err((key, UnreadyError::Inner(error))))) => {
                    debug!(%error, "service failed while unready, dropping service");
                    let cancel = self.cancel_handles.remove(&key);
                    assert!(cancel.is_some(), "missing cancel handle");
                }
            }
        }
    }
fn poll_unready ( & mut self , cx : & mut Context < ' _ > ) { loop { match Pin :: new ( & mut self . unready_services ) . poll_next ( cx ) { // No unready service changes, or empty unready services Poll :: Pending | Poll :: Ready ( None ) => return , // Unready -> Ready Poll :: Ready ( Some ( Ok ( ( key , svc ) ) ) ) => { trace ! ( key " " ) ; let cancel = self . cancel_handles . remove ( & key ) ; assert ! ( cancel is_some ( ) " " ) ; if svc . version ( ) >= self . minimum_peer_version . current ( ) { self . ready_services . insert ( key , svc ) ; } } // Unready -> Canceled Poll :: Ready ( Some ( Err ( ( key , UnreadyError :: Canceled ) ) ) ) => { // A service be canceled because we've connected to the same service twice. // In that case, there is a cancel handle for the peer address, // but it belongs to the service for the newer connection. trace ! ( key duplicate_connection self cancel_handles contains_key ( key ) " " ) ; } Poll :: Ready ( Some ( Err ( ( key , UnreadyError :: CancelHandleDropped ( _ ) ) ) ) ) => { // Similarly, services with dropped cancel handes can have duplicates. trace ! ( key duplicate_connection self cancel_handles contains_key ( key ) " " ) ; } // Unready -> Errored Poll :: Ready ( Some ( Err ( ( key , UnreadyError :: Inner ( error ) ) ) ) ) => { debug ! ( error " " ) ; let cancel = self . cancel_handles . remove ( & key ) ; assert ! ( cancel is_some ( ) " " ) ; } } } }
Check busy peer services for request completion or errors.
Check busy peer services for request completion or errors .
&mut self
cx
&mut Context<'_>