pub struct TopicPartitionList { /* private fields */ }Expand description
A structure to store and manipulate a list of topics and partitions with optional offsets.
Implementations§
Source§impl TopicPartitionList
impl TopicPartitionList
Sourcepub fn new() -> TopicPartitionList
Available on non-madsim only.
pub fn new() -> TopicPartitionList
madsim only.Creates a new empty list with default capacity.
Sourcepub fn with_capacity(capacity: usize) -> TopicPartitionList
Available on non-madsim only.
pub fn with_capacity(capacity: usize) -> TopicPartitionList
madsim only.Creates a new empty list with the specified capacity.
Sourcepub fn from_topic_map(
topic_map: &HashMap<(String, i32), Offset>,
) -> KafkaResult<TopicPartitionList>
Available on non-madsim only.
pub fn from_topic_map( topic_map: &HashMap<(String, i32), Offset>, ) -> KafkaResult<TopicPartitionList>
madsim only.Given a topic map, generates a new TopicPartitionList.
Sourcepub fn ptr(&self) -> *mut RDKafkaTopicPartitionList
Available on non-madsim only.
pub fn ptr(&self) -> *mut RDKafkaTopicPartitionList
madsim only.Returns the pointer to the internal librdkafka structure.
Sourcepub fn count(&self) -> usize
Available on non-madsim only.
pub fn count(&self) -> usize
madsim only.Returns the number of elements in the list.
Sourcepub fn add_topic_unassigned<'a>(
&'a mut self,
topic: &str,
) -> TopicPartitionListElem<'a>
Available on non-madsim only.
pub fn add_topic_unassigned<'a>( &'a mut self, topic: &str, ) -> TopicPartitionListElem<'a>
madsim only.Adds a topic with unassigned partitions to the list.
Sourcepub fn add_partition<'a>(
&'a mut self,
topic: &str,
partition: i32,
) -> TopicPartitionListElem<'a>
Available on non-madsim only.
pub fn add_partition<'a>( &'a mut self, topic: &str, partition: i32, ) -> TopicPartitionListElem<'a>
madsim only.Adds a topic and partition to the list.
Sourcepub fn add_partition_range(
&mut self,
topic: &str,
start_partition: i32,
stop_partition: i32,
)
Available on non-madsim only.
pub fn add_partition_range( &mut self, topic: &str, start_partition: i32, stop_partition: i32, )
madsim only.Adds a topic and partition range to the list.
Sourcepub fn set_partition_offset(
&mut self,
topic: &str,
partition: i32,
offset: Offset,
) -> KafkaResult<()>
Available on non-madsim only.
pub fn set_partition_offset( &mut self, topic: &str, partition: i32, offset: Offset, ) -> KafkaResult<()>
madsim only.Sets the offset for an already created topic partition. It will fail if the topic partition isn’t in the list.
Sourcepub fn add_partition_offset(
&mut self,
topic: &str,
partition: i32,
offset: Offset,
) -> KafkaResult<()>
Available on non-madsim only.
pub fn add_partition_offset( &mut self, topic: &str, partition: i32, offset: Offset, ) -> KafkaResult<()>
madsim only.Adds a topic and partition to the list, with the specified offset.
Sourcepub fn find_partition(
&self,
topic: &str,
partition: i32,
) -> Option<TopicPartitionListElem<'_>>
Available on non-madsim only.
pub fn find_partition( &self, topic: &str, partition: i32, ) -> Option<TopicPartitionListElem<'_>>
madsim only.Given a topic name and a partition number, returns the corresponding list element.
Sourcepub fn set_all_offsets(&mut self, offset: Offset) -> Result<(), KafkaError>
Available on non-madsim only.
pub fn set_all_offsets(&mut self, offset: Offset) -> Result<(), KafkaError>
madsim only.Sets all partitions in the list to the specified offset.
Sourcepub fn elements(&self) -> Vec<TopicPartitionListElem<'_>>
Available on non-madsim only.
pub fn elements(&self) -> Vec<TopicPartitionListElem<'_>>
madsim only.Returns all the elements of the list.
Sourcepub fn elements_for_topic<'a>(
&'a self,
topic: &str,
) -> Vec<TopicPartitionListElem<'a>>
Available on non-madsim only.
pub fn elements_for_topic<'a>( &'a self, topic: &str, ) -> Vec<TopicPartitionListElem<'a>>
madsim only.Returns all the elements of the list that belong to the specified topic.
Trait Implementations§
Source§impl Clone for TopicPartitionList
Available on non-madsim only.
impl Clone for TopicPartitionList
madsim only.Source§impl Debug for TopicPartitionList
Available on non-madsim only.
impl Debug for TopicPartitionList
madsim only.Source§impl Default for TopicPartitionList
Available on non-madsim only.
impl Default for TopicPartitionList
madsim only.Source§impl PartialEq for TopicPartitionList
Available on non-madsim only.
impl PartialEq for TopicPartitionList
madsim only.impl Send for TopicPartitionList
madsim only.impl Sync for TopicPartitionList
madsim only.