fn fetch_metadata<T: AsRef<str>>(&mut self,
                                     topics: &[T])
                                     -> Result<protocol::MetadataResponse> {
        let correlation = self.state.next_correlation_id();
        let now = Instant::now();
        for host in &self.config.hosts {
            debug!("fetch_metadata: requesting metadata from {}", host);
            match self.conn_pool.get_conn(host, now) {
                Ok(conn) => {
                    let req =
                        protocol::MetadataRequest::new(correlation, &self.config.client_id, topics);
                    match __send_request(conn, req) {
                        Ok(_) => return __get_response::<protocol::MetadataResponse>(conn),
                        Err(e) => {
                            debug!("fetch_metadata: failed to request metadata from {}: {}",
                                   host,
                                   e)
                        }
                    }
                }
                Err(e) => {
                    debug!("fetch_metadata: failed to connect to {}: {}", host, e);
                }
            }
        }
        Err(Error::NoHostReachable)
    }
/// Fetches metadata about the specified topics from all of the
/// underlying brokers (`self.hosts`).
Fetches metadata about the specified topics from all of the
underlying brokers (`self.hosts`).
Fetches metadata about the specified topics from all of the underlying brokers ( ` self . hosts ` ) .
fn fetch_metadata<T: AsRef<str>>(&mut self,
                                     topics: &[T])
                                     -> Result<protocol::MetadataResponse> {
        let correlation = self.state.next_correlation_id();
        let now = Instant::now();
        for host in &self.config.hosts {
            debug!("fetch_metadata: requesting metadata from {}", host);
            match self.conn_pool.get_conn(host, now) {
                Ok(conn) => {
                    let req =
                        protocol::MetadataRequest::new(correlation, &self.config.client_id, topics);
                    match __send_request(conn, req) {
                        Ok(_) => return __get_response::<protocol::MetadataResponse>(conn),
                        Err(e) => {
                            debug!("fetch_metadata: failed to request metadata from {}: {}",
                                   host,
                                   e)
                        }
                    }
                }
                Err(e) => {
                    debug!("fetch_metadata: failed to connect to {}: {}", host, e);
                }
            }
        }
        Err(Error::NoHostReachable)
    }
fn fetch_metadata < T : AsRef < str > > ( & mut self , topics : & [ T ] ) -> Result < protocol :: MetadataResponse > { let correlation = self . state . next_correlation_id ( ) ; let now = Instant :: now ( ) ; for host in & self . config . hosts { debug ! ( " " host ) ; match self . conn_pool . get_conn ( host , now ) { Ok ( conn ) => { let req = protocol :: MetadataRequest :: new ( correlation , & self . config . client_id , topics ) ; match __send_request ( conn , req ) { Ok ( _ ) => return __get_response :: < protocol :: MetadataResponse > ( conn ) , Err ( e ) => { debug ! ( " " host e ) } } } Err ( e ) => { debug ! ( " " host e ) ; } } } Err ( Error :: NoHostReachable ) }
Fetches metadata about the specified topics from all of the
underlying brokers (`self.hosts`).
Fetches metadata about the specified topics from all of the underlying brokers ( ` self . hosts ` ) .
&mut self
topics
&[T]