fn poll_discover(&mut self, cx: &mut Context<'_>) -> Poll<Result<(), BoxError>> {
        use futures::ready;
        loop {
            match ready!(Pin::new(&mut self.discover).poll_discover(cx))
                .ok_or("discovery stream closed")?
                .map_err(Into::into)?
            {
                Change::Remove(key) => {
                    trace!(?key, "got Change::Remove from Discover");
                    self.remove(&key);
                }
                Change::Insert(key, svc) => {
                    // We add peers as unready, so that we:
                    // - always do the same checks on every ready peer, and
                    // - check for any errors that happened right after the handshake
                    trace!(?key, "got Change::Insert from Discover");
                    self.remove(&key);
                    self.push_unready(key, svc);
                }
            }
        }
    }
/// Checks for newly inserted or removed services.
///
/// Puts inserted services in the unready list.
/// Drops removed services, after cancelling any pending requests.
Checks for newly inserted or removed services.
Puts inserted services in the unready list.
Drops removed services, after cancelling any pending requests.
Checks for newly inserted or removed services . Puts inserted services in the unready list . Drops removed services after cancelling any pending requests .
fn poll_discover(&mut self, cx: &mut Context<'_>) -> Poll<Result<(), BoxError>> {
        use futures::ready;
        loop {
            match ready!(Pin::new(&mut self.discover).poll_discover(cx))
                .ok_or("discovery stream closed")?
                .map_err(Into::into)?
            {
                Change::Remove(key) => {
                    trace!(?key, "got Change::Remove from Discover");
                    self.remove(&key);
                }
                Change::Insert(key, svc) => {
                    // We add peers as unready, so that we:
                    // - always do the same checks on every ready peer, and
                    // - check for any errors that happened right after the handshake
                    trace!(?key, "got Change::Insert from Discover");
                    self.remove(&key);
                    self.push_unready(key, svc);
                }
            }
        }
    }
fn poll_discover ( & mut self , cx : & mut Context < ' _ > ) -> Poll < Result < ( ) , BoxError > > { use futures :: ready ; loop { match ready ! ( Pin new ( mut self discover ) poll_discover ( cx ) ) . ok_or ( " " ) ? . map_err ( Into :: into ) ? { Change :: Remove ( key ) => { trace ! ( key " " ) ; self . remove ( & key ) ; } Change :: Insert ( key , svc ) => { // We add peers as unready, so that we: // - always do the same checks on every ready peer, and // - check for any errors that happened right after the handshake trace ! ( key " " ) ; self . remove ( & key ) ; self . push_unready ( key , svc ) ; } } } }
Checks for newly inserted or removed services.
Checks for newly inserted or removed services .
&mut self
cx
&mut Context<'_>