kafka_client_engine/admin/describe_consumer_groups/
assignment.rs1#[derive(Clone, Debug, Eq, PartialEq)]
5pub struct ConsumerGroupTopicPartitions {
6 topic_id: [u8; 16],
7 topic_name: String,
8 partitions: Vec<i32>,
9}
10
11impl ConsumerGroupTopicPartitions {
12 pub(crate) const fn new(topic_id: [u8; 16], topic_name: String, partitions: Vec<i32>) -> Self {
13 Self {
14 topic_id,
15 topic_name,
16 partitions,
17 }
18 }
19
20 pub fn into_parts(self) -> ([u8; 16], String, Vec<i32>) {
22 (self.topic_id, self.topic_name, self.partitions)
23 }
24}
25
26#[derive(Clone, Debug, Eq, PartialEq)]
28pub struct ConsumerGroupAssignment {
29 topics: Vec<ConsumerGroupTopicPartitions>,
30}
31
32impl ConsumerGroupAssignment {
33 pub(crate) const fn new(topics: Vec<ConsumerGroupTopicPartitions>) -> Self {
34 Self { topics }
35 }
36
37 pub fn into_topics(self) -> Vec<ConsumerGroupTopicPartitions> {
39 self.topics
40 }
41}