Struct rdkafka::topic_partition_list::TopicPartitionList
[−]
[src]
pub struct TopicPartitionList { /* fields omitted */ }
A structure to store and manipulate a list of topics and partitions with optional offsets.
Methods
impl TopicPartitionList
[src]
fn new() -> TopicPartitionList
Creates a new empty list with default capacity.
fn with_capacity(capacity: usize) -> TopicPartitionList
Creates a new empty list with the specified capacity.
unsafe fn from_ptr(ptr: *mut RDKafkaTopicPartitionList) -> TopicPartitionList
Transforms a pointer to the native librdkafka RDTopicPartitionList into a
managed TopicPartitionList
instance.
fn from_topic_map(
topic_map: &HashMap<(String, i32), Offset>
) -> TopicPartitionList
topic_map: &HashMap<(String, i32), Offset>
) -> TopicPartitionList
Given a topic map, generates a new TopicPartitionList
.
fn ptr(&self) -> *mut RDKafkaTopicPartitionList
Returns the pointer to the internal librdkafka structure.
unsafe fn leak(self)
Capture the instance without calling the destructor on the internal librdkafka structure.
fn count(&self) -> usize
Returns the number of elements in the list.
fn capacity(&self) -> usize
Returns the capacity of the list.
fn add_topic_unassigned<'a>(
&'a mut self,
topic: &str
) -> TopicPartitionListElem<'a>
&'a mut self,
topic: &str
) -> TopicPartitionListElem<'a>
Adds a topic with unassigned partitions to the list.
fn add_partition<'a>(
&'a mut self,
topic: &str,
partition: i32
) -> TopicPartitionListElem<'a>
&'a mut self,
topic: &str,
partition: i32
) -> TopicPartitionListElem<'a>
Adds a topic and partition to the list.
fn add_partition_range(
&mut self,
topic: &str,
start_partition: i32,
stop_partition: i32
)
&mut self,
topic: &str,
start_partition: i32,
stop_partition: i32
)
Adds a topic and partition range to the list.
fn set_partition_offset(
&mut self,
topic: &str,
partition: i32,
offset: Offset
) -> KafkaResult<()>
&mut self,
topic: &str,
partition: i32,
offset: Offset
) -> KafkaResult<()>
Sets the offset for an already created topic partition. It will fail if the topic partition isn't in the list.
fn add_partition_offset<'a>(
&'a mut self,
topic: &str,
partition: i32,
offset: Offset
)
&'a mut self,
topic: &str,
partition: i32,
offset: Offset
)
Adds a topic and partition to the list, with the specified offset.
fn find_partition(
&self,
topic: &str,
partition: i32
) -> Option<TopicPartitionListElem>
&self,
topic: &str,
partition: i32
) -> Option<TopicPartitionListElem>
Given a topic name and a partition number, returns the corresponding list element.
fn set_all_offsets(&mut self, offset: Offset)
Sets all partitions in the list to the specified offset.
fn elements(&self) -> Vec<TopicPartitionListElem>
Returns all the elements of the list.
fn elements_for_topic<'a>(
&'a self,
topic: &str
) -> Vec<TopicPartitionListElem<'a>>
&'a self,
topic: &str
) -> Vec<TopicPartitionListElem<'a>>
Returns all the elements of the list that belong to the specified topic.
fn to_topic_map(&self) -> HashMap<(String, i32), Offset>
Returns a hashmap-based representation of the list.
Trait Implementations
impl Clone for TopicPartitionList
[src]
fn clone(&self) -> Self
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl Drop for TopicPartitionList
[src]
impl PartialEq for TopicPartitionList
[src]
fn eq(&self, other: &TopicPartitionList) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0
This method tests for !=
.