pub fn fetch_topic_offsets<T: AsRef<str>>(&mut self,
                                              topic: T,
                                              offset: FetchOffset)
                                              -> Result<Vec<PartitionOffset>> {
        let topic = topic.as_ref();

        let mut m = try!(self.fetch_offsets(&[topic], offset));
        let offs = m.remove(topic).unwrap_or(vec![]);
        if offs.is_empty() {
            Err(Error::Kafka(KafkaCode::UnknownTopicOrPartition))
        } else {
            Ok(offs)
        }
    }
/// Fetch offset for a single topic.
///
/// # Examples
///
/// ```no_run
/// use kafka::client::{KafkaClient, FetchOffset};
///
/// let mut client = KafkaClient::new(vec!["localhost:9092".to_owned()]);
/// client.load_metadata_all().unwrap();
/// let offsets = client.fetch_topic_offsets("my-topic", FetchOffset::Latest).unwrap();
/// ```
///
/// Returns a vector of the offset data for each available partition.
/// See also `KafkaClient::fetch_offsets`.
Fetch offset for a single topic.
Fetch offset for a single topic .
pub fn fetch_topic_offsets<T: AsRef<str>>(&mut self,
                                              topic: T,
                                              offset: FetchOffset)
                                              -> Result<Vec<PartitionOffset>> {
        let topic = topic.as_ref();
        let mut m = try!(self.fetch_offsets(&[topic], offset));
        let offs = m.remove(topic).unwrap_or(vec![]);
        if offs.is_empty() {
            Err(Error::Kafka(KafkaCode::UnknownTopicOrPartition))
        } else {
            Ok(offs)
        }
    }
pub fn fetch_topic_offsets < T : AsRef < str > > ( & mut self , topic : T , offset : FetchOffset ) -> Result < Vec < PartitionOffset > > { let topic = topic . as_ref ( ) ; let mut m = try ! ( self fetch_offsets ( [ topic ] offset ) ) ; let offs = m . remove ( topic ) . unwrap_or ( vec ! [ ] ) ; if offs . is_empty ( ) { Err ( Error :: Kafka ( KafkaCode :: UnknownTopicOrPartition ) ) } else { Ok ( offs ) } }
Fetch offset for a single topic.
Fetch offset for a single topic .
&mut self
topic
T
offset
FetchOffset
examples
```no_run
use kafka::client::{KafkaClient, FetchOffset}.

let mut client = KafkaClient::new(vec!["localhost:9092".to_owned()]);
client.load_metadata_all().unwrap();
let offsets = client.fetch_topic_offsets("my-topic", FetchOffset::Latest).unwrap();
```

Returns a vector of the offset data for each available partition.
See also `KafkaClient::fetch_offsets`.
` ` ` no_run use kafka :: client :: { KafkaClient FetchOffset } . let mut client = KafkaClient :: new ( vec! [ " localhost : 9092 " . to_owned () ] ) ; client . load_metadata_all () . unwrap () ; let offsets = client . fetch_topic_offsets ( " my - topic " FetchOffset :: Latest ) . unwrap () ; ` ` ` Returns a vector of the offset data for each available partition . See also ` KafkaClient :: fetch_offsets ` .