Struct rdkafka::topic_partition_list::TopicPartitionList
source · [−]pub struct TopicPartitionList { /* private fields */ }
Expand description
A structure to store and manipulate a list of topics and partitions with optional offsets.
Implementations
Creates a new empty list with default capacity.
Creates a new empty list with the specified capacity.
pub fn from_topic_map(
topic_map: &HashMap<(String, i32), Offset>
) -> KafkaResult<TopicPartitionList>
pub fn from_topic_map(
topic_map: &HashMap<(String, i32), Offset>
) -> KafkaResult<TopicPartitionList>
Given a topic map, generates a new TopicPartitionList
.
Returns the pointer to the internal librdkafka structure.
Adds a topic with unassigned partitions to the list.
pub fn add_partition<'a>(
&'a mut self,
topic: &str,
partition: i32
) -> TopicPartitionListElem<'a>
pub fn add_partition<'a>(
&'a mut self,
topic: &str,
partition: i32
) -> TopicPartitionListElem<'a>
Adds a topic and partition to the list.
pub fn add_partition_range(
&mut self,
topic: &str,
start_partition: i32,
stop_partition: i32
)
pub fn add_partition_range(
&mut self,
topic: &str,
start_partition: i32,
stop_partition: i32
)
Adds a topic and partition range to the list.
pub fn set_partition_offset(
&mut self,
topic: &str,
partition: i32,
offset: Offset
) -> KafkaResult<()>
pub fn set_partition_offset(
&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.
pub fn add_partition_offset(
&mut self,
topic: &str,
partition: i32,
offset: Offset
) -> KafkaResult<()>
pub fn add_partition_offset(
&mut self,
topic: &str,
partition: i32,
offset: Offset
) -> KafkaResult<()>
Adds a topic and partition to the list, with the specified offset.
pub fn find_partition(
&self,
topic: &str,
partition: i32
) -> Option<TopicPartitionListElem<'_>>
pub fn find_partition(
&self,
topic: &str,
partition: i32
) -> Option<TopicPartitionListElem<'_>>
Given a topic name and a partition number, returns the corresponding list element.
Sets all partitions in the list to the specified offset.
Returns all the elements of the list.
Returns all the elements of the list that belong to the specified topic.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for TopicPartitionList
impl Unpin for TopicPartitionList
impl UnwindSafe for TopicPartitionList
Blanket Implementations
Mutably borrows from an owned value. Read more