[][src]Struct rdkafka::topic_partition_list::TopicPartitionList

pub struct TopicPartitionList { /* fields omitted */ }

A structure to store and manipulate a list of topics and partitions with optional offsets.

Methods

impl TopicPartitionList[src]

pub fn new() -> TopicPartitionList[src]

Creates a new empty list with default capacity.

pub fn with_capacity(capacity: usize) -> TopicPartitionList[src]

Creates a new empty list with the specified capacity.

pub fn from_topic_map(
    topic_map: &HashMap<(String, i32), Offset>
) -> TopicPartitionList
[src]

Given a topic map, generates a new TopicPartitionList.

pub fn ptr(&self) -> *mut RDKafkaTopicPartitionList[src]

Returns the pointer to the internal librdkafka structure.

pub fn count(&self) -> usize[src]

Returns the number of elements in the list.

pub fn capacity(&self) -> usize[src]

Returns the capacity of the list.

pub fn add_topic_unassigned<'a>(
    &'a mut self,
    topic: &str
) -> TopicPartitionListElem<'a>
[src]

Adds a topic with unassigned partitions to the list.

pub fn add_partition<'a>(
    &'a mut self,
    topic: &str,
    partition: i32
) -> TopicPartitionListElem<'a>
[src]

Adds a topic and partition to the list.

pub fn add_partition_range(
    &mut self,
    topic: &str,
    start_partition: i32,
    stop_partition: i32
)
[src]

Adds a topic and partition range to the list.

pub fn set_partition_offset(
    &mut self,
    topic: &str,
    partition: i32,
    offset: Offset
) -> KafkaResult<()>
[src]

Sets the offset for an already created topic partition. It will fail if the topic partition isn't in the list.

pub fn add_partition_offset(
    &mut self,
    topic: &str,
    partition: i32,
    offset: Offset
)
[src]

Adds a topic and partition to the list, with the specified offset.

pub fn find_partition(
    &self,
    topic: &str,
    partition: i32
) -> Option<TopicPartitionListElem>
[src]

Given a topic name and a partition number, returns the corresponding list element.

pub fn set_all_offsets(&mut self, offset: Offset)[src]

Sets all partitions in the list to the specified offset.

pub fn elements(&self) -> Vec<TopicPartitionListElem>[src]

Returns all the elements of the list.

pub fn elements_for_topic<'a>(
    &'a self,
    topic: &str
) -> Vec<TopicPartitionListElem<'a>>
[src]

Returns all the elements of the list that belong to the specified topic.

pub fn to_topic_map(&self) -> HashMap<(String, i32), Offset>[src]

Returns a hashmap-based representation of the list.

Trait Implementations

impl Clone for TopicPartitionList[src]

impl Debug for TopicPartitionList[src]

impl Default for TopicPartitionList[src]

impl Drop for TopicPartitionList[src]

impl PartialEq<TopicPartitionList> for TopicPartitionList[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.