// Query Kafka server for Brokers & Topic Metadata
Query Kafka server for Brokers & Topic Metadata
Query Kafka server for Brokers & Topic Metadata
pub async fn query_metadata(
        &mut self,
        topics: Option<Vec<String>>,
    ) -> Result<KfMetadataResponse, KfSocketError> {
        let mut request = KfMetadataRequest::default();
        // request topics metadata
        let request_topics = if let Some(topics) = topics {
            let mut req_topics: Vec<MetadataRequestTopic> = vec![];
            for name in topics {
                req_topics.push(MetadataRequestTopic { name });
            }
            Some(req_topics)
        } else {
            None
        };
        request.topics = request_topics;
        self.0.send_receive(request).await
    }
pub async fn query_metadata ( & mut self , topics : Option < Vec < String > > , ) -> Result < KfMetadataResponse , KfSocketError > { let mut request = KfMetadataRequest :: default ( ) ; // request topics metadata let request_topics = if let Some ( topics ) = topics { let mut req_topics : Vec < MetadataRequestTopic > = vec ! [ ] ; for name in topics { req_topics . push ( MetadataRequestTopic { name } ) ; } Some ( req_topics ) } else { None } ; request . topics = request_topics ; self . 0 . send_receive ( request ) . await }
Query Kafka server for Brokers & Topic Metadata
Query Kafka server for Brokers & Topic Metadata
&mut self
topics
Option<Vec<String>>