kafka_client_engine/admin/describe_topic_partitions/outcome/
topic.rs1use super::AdminDescribeTopicPartition;
4
5#[derive(Clone, Debug, Eq, PartialEq)]
7pub struct AdminDescribeTopicPartitionsTopic {
8 pub(super) error_code: i16,
9 pub(super) name: String,
10 pub(super) topic_id: [u8; 16],
11 pub(super) internal: bool,
12 pub(super) partitions: Vec<AdminDescribeTopicPartition>,
13 pub(super) authorized_operations: i32,
14}
15
16impl AdminDescribeTopicPartitionsTopic {
17 pub const fn error_code(&self) -> i16 {
19 self.error_code
20 }
21
22 pub fn name(&self) -> &str {
24 &self.name
25 }
26
27 pub const fn topic_id(&self) -> [u8; 16] {
29 self.topic_id
30 }
31
32 pub const fn internal(&self) -> bool {
34 self.internal
35 }
36
37 pub fn partitions(&self) -> &[AdminDescribeTopicPartition] {
39 &self.partitions
40 }
41
42 pub const fn authorized_operations(&self) -> i32 {
44 self.authorized_operations
45 }
46
47 pub fn into_parts(
49 self,
50 ) -> (
51 i16,
52 String,
53 [u8; 16],
54 bool,
55 Vec<AdminDescribeTopicPartition>,
56 i32,
57 ) {
58 (
59 self.error_code,
60 self.name,
61 self.topic_id,
62 self.internal,
63 self.partitions,
64 self.authorized_operations,
65 )
66 }
67}