pub fn fetch_group_offsets<'a, J, I>(&mut self,
                                         group: &str,
                                         partitions: I)
                                         -> Result<Vec<TopicPartitionOffset>>
        where J: AsRef<FetchGroupOffset<'a>>,
              I: IntoIterator<Item = J>
    {
        let mut req = protocol::OffsetFetchRequest::new(group,
                                                        self.config.offset_fetch_version,
                                                        self.state.next_correlation_id(),
                                                        &self.config.client_id);
        let mut num = 0;
        for p in partitions {
            let p = p.as_ref();
            if self.state.contains_topic_partition(p.topic, p.partition) {
                req.add(p.topic, p.partition);
                num += 1;
            } else {
                return Err(Error::Kafka(KafkaCode::UnknownTopicOrPartition));
            }
        }
        __fetch_group_offsets(req, num, &mut self.state, &mut self.conn_pool, &self.config)
    }
/// Fetch offset for a specified list of topic partitions of a consumer group
///
/// # Examples
///
/// ```no_run
/// use kafka::client::{KafkaClient, FetchGroupOffset};
///
/// let mut client = KafkaClient::new(vec!["localhost:9092".to_owned()]);
/// client.load_metadata_all().unwrap();
///
/// let offsets =
///      client.fetch_group_offsets("my-group",
///             &[FetchGroupOffset::new("my-topic", 0),
///               FetchGroupOffset::new("my-topic", 1)])
///             .unwrap();
/// ```
///
/// See also `KafkaClient::fetch_group_topic_offsets`.
Fetch offset for a specified list of topic partitions of a consumer group
Fetch offset for a specified list of topic partitions of a consumer group
pub fn fetch_group_offsets<'a, J, I>(&mut self,
                                         group: &str,
                                         partitions: I)
                                         -> Result<Vec<TopicPartitionOffset>>
        where J: AsRef<FetchGroupOffset<'a>>,
              I: IntoIterator<Item = J>
    {
        let mut req = protocol::OffsetFetchRequest::new(group,
                                                        self.config.offset_fetch_version,
                                                        self.state.next_correlation_id(),
                                                        &self.config.client_id);
        let mut num = 0;
        for p in partitions {
            let p = p.as_ref();
            if self.state.contains_topic_partition(p.topic, p.partition) {
                req.add(p.topic, p.partition);
                num += 1;
            } else {
                return Err(Error::Kafka(KafkaCode::UnknownTopicOrPartition));
            }
        }
        __fetch_group_offsets(req, num, &mut self.state, &mut self.conn_pool, &self.config)
    }
pub fn fetch_group_offsets < ' a , J , I > ( & mut self , group : & str , partitions : I ) -> Result < Vec < TopicPartitionOffset > > where J : AsRef < FetchGroupOffset < ' a > > , I : IntoIterator < Item = J > { let mut req = protocol :: OffsetFetchRequest :: new ( group , self . config . offset_fetch_version , self . state . next_correlation_id ( ) , & self . config . client_id ) ; let mut num = 0 ; for p in partitions { let p = p . as_ref ( ) ; if self . state . contains_topic_partition ( p . topic , p . partition ) { req . add ( p . topic , p . partition ) ; num += 1 ; } else { return Err ( Error :: Kafka ( KafkaCode :: UnknownTopicOrPartition ) ) ; } } __fetch_group_offsets ( req , num , & mut self . state , & mut self . conn_pool , & self . config ) }
Fetch offset for a specified list of topic partitions of a consumer group
Fetch offset for a specified list of topic partitions of a consumer group
&mut self
group
&str
partitions
I
examples
```no_run
use kafka::client::{KafkaClient, FetchGroupOffset}.

let mut client = KafkaClient::new(vec!["localhost:9092".to_owned()]);
client.load_metadata_all().unwrap().

let offsets
client.fetch_group_offsets("my-group",
&[FetchGroupOffset::new("my-topic", 0),
FetchGroupOffset::new("my-topic", 1)])
.unwrap();
```

See also `KafkaClient::fetch_group_topic_offsets`.
` ` ` no_run use kafka :: client :: { KafkaClient FetchGroupOffset } . let mut client = KafkaClient :: new ( vec! [ " localhost : 9092 " . to_owned () ] ) ; client . load_metadata_all () . unwrap () . let offsets client . fetch_group_offsets ( " my - group " & [ FetchGroupOffset :: new ( " my - topic " 0 ) FetchGroupOffset :: new ( " my - topic " 1 ) ] ) . unwrap () ; ` ` ` See also ` KafkaClient :: fetch_group_topic_offsets ` .