fn poll_queries(&mut self, cx: &mut Context) -> Option<(Option<Instant>, Vec<Enr>)> {
        while let Poll::Ready(Some(query_future)) = self.active_queries.poll_next_unpin(cx) {
            match query_future.0 {
                QueryType::FindPeers => {
                    self.find_peer_active = false;
                    match query_future.1 {
                        Ok(r) if r.is_empty() => {
                            debug!(self.log, "Discovery query yielded no results.");
                        }
                        Ok(r) => {
                            debug!(self.log, "Discovery query completed"; "peers_found" => r.len());
                            return Some((None, r));
                        }
                        Err(e) => {
                            warn!(self.log, "Discovery query failed"; "error" => e.to_string());
                        }
                    }
                }
                QueryType::Subnet {
                    subnet_id,
                    min_ttl,
                    retries,
                } => {}
            }
        }
        None
    }
/// Drives the queries returning any results from completed queries.
Drives the queries returning any results from completed queries.
Drives the queries returning any results from completed queries .
fn poll_queries(&mut self, cx: &mut Context) -> Option<(Option<Instant>, Vec<Enr>)> {
        while let Poll::Ready(Some(query_future)) = self.active_queries.poll_next_unpin(cx) {
            match query_future.0 {
                QueryType::FindPeers => {
                    self.find_peer_active = false;
                    match query_future.1 {
                        Ok(r) if r.is_empty() => {
                            debug!(self.log, "Discovery query yielded no results.");
                        }
                        Ok(r) => {
                            debug!(self.log, "Discovery query completed"; "peers_found" => r.len());
                            return Some((None, r));
                        }
                        Err(e) => {
                            warn!(self.log, "Discovery query failed"; "error" => e.to_string());
                        }
                    }
                }
                QueryType::Subnet {
                    subnet_id,
                    min_ttl,
                    retries,
                } => {}
            }
        }
        None
    }
fn poll_queries ( & mut self , cx : & mut Context ) -> Option < ( Option < Instant > , Vec < Enr > ) > { while let Poll :: Ready ( Some ( query_future ) ) = self . active_queries . poll_next_unpin ( cx ) { match query_future . 0 { QueryType :: FindPeers => { self . find_peer_active = false ; match query_future . 1 { Ok ( r ) if r . is_empty ( ) => { debug ! ( self log " " ) ; } Ok ( r ) => { debug ! ( self log " " " " r len ( ) ) ; return Some ( ( None , r ) ) ; } Err ( e ) => { warn ! ( self log " " " " e to_string ( ) ) ; } } } QueryType :: Subnet { subnet_id , min_ttl , retries , } => { } } } None }
Drives the queries returning any results from completed queries.
Drives the queries returning any results from completed queries .
&mut self
cx
&mut Context
&mut self
cx
&mut Context