[][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 Drop for TopicPartitionList
[src]

impl Default for TopicPartitionList
[src]

impl PartialEq<TopicPartitionList> for TopicPartitionList
[src]

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0
[src]

This method tests for !=.

impl Clone for TopicPartitionList
[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for TopicPartitionList
[src]

Auto Trait Implementations

Blanket Implementations

impl<T> From for T
[src]

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

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

type Owned = T

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

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

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

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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