kafka_client_engine/admin/configs/
outcome.rs1#[derive(Clone, Copy, Debug, Eq, PartialEq)]
5pub enum DescribeConfigsDeliveryStatus {
6 NotSent,
8 PossiblySent,
10}
11
12#[derive(Clone, Debug, Eq, PartialEq)]
14pub struct DescribeConfigSynonym {
15 pub(super) name: String,
16 pub(super) value: Option<String>,
17 pub(super) source: i8,
18}
19
20impl DescribeConfigSynonym {
21 pub fn into_parts(self) -> (String, Option<String>, i8) {
23 (self.name, self.value, self.source)
24 }
25}
26
27#[derive(Clone, Debug, Eq, PartialEq)]
29pub struct DescribeConfigEntry {
30 pub(super) name: String,
31 pub(super) value: Option<String>,
32 pub(super) read_only: bool,
33 pub(super) source: i8,
34 pub(super) sensitive: bool,
35 pub(super) synonyms: Vec<DescribeConfigSynonym>,
36 pub(super) config_type: Option<i8>,
37 pub(super) documentation: Option<String>,
38}
39
40impl DescribeConfigEntry {
41 pub fn name(&self) -> &str {
43 &self.name
44 }
45
46 pub fn value(&self) -> Option<&str> {
48 self.value.as_deref()
49 }
50
51 pub const fn read_only(&self) -> bool {
53 self.read_only
54 }
55
56 pub const fn source(&self) -> i8 {
58 self.source
59 }
60
61 pub const fn sensitive(&self) -> bool {
63 self.sensitive
64 }
65
66 pub fn synonyms(&self) -> &[DescribeConfigSynonym] {
68 &self.synonyms
69 }
70
71 pub const fn config_type(&self) -> Option<i8> {
73 self.config_type
74 }
75
76 pub fn documentation(&self) -> Option<&str> {
78 self.documentation.as_deref()
79 }
80
81 #[allow(clippy::type_complexity)]
83 pub fn into_parts(
84 self,
85 ) -> (
86 String,
87 Option<String>,
88 bool,
89 i8,
90 bool,
91 Vec<DescribeConfigSynonym>,
92 Option<i8>,
93 Option<String>,
94 ) {
95 (
96 self.name,
97 self.value,
98 self.read_only,
99 self.source,
100 self.sensitive,
101 self.synonyms,
102 self.config_type,
103 self.documentation,
104 )
105 }
106}
107
108#[derive(Clone, Debug, Eq, PartialEq)]
110pub struct DescribeConfigResourceError {
111 pub(super) code: i16,
112 pub(super) message: Option<String>,
113 pub(super) message_truncated: bool,
114}
115
116impl DescribeConfigResourceError {
117 pub const fn code(&self) -> i16 {
119 self.code
120 }
121
122 pub fn message(&self) -> Option<&str> {
124 self.message.as_deref()
125 }
126
127 pub const fn message_truncated(&self) -> bool {
129 self.message_truncated
130 }
131
132 pub fn into_parts(self) -> (i16, Option<String>, bool) {
134 (self.code, self.message, self.message_truncated)
135 }
136}
137
138#[derive(Clone, Debug, Eq, PartialEq)]
140pub struct DescribeConfigResourceResult {
141 pub(super) resource_type: i8,
142 pub(super) resource_name: String,
143 pub(super) result: Result<Vec<DescribeConfigEntry>, DescribeConfigResourceError>,
144}
145
146impl DescribeConfigResourceResult {
147 pub fn into_parts(
149 self,
150 ) -> (
151 i8,
152 String,
153 Result<Vec<DescribeConfigEntry>, DescribeConfigResourceError>,
154 ) {
155 (self.resource_type, self.resource_name, self.result)
156 }
157}
158
159#[derive(Clone, Debug, Eq, PartialEq)]
161pub struct DescribeConfigsBatch {
162 pub(super) throttle_time_ms: u32,
163 pub(super) resources: Vec<DescribeConfigResourceResult>,
164}
165
166impl DescribeConfigsBatch {
167 pub const fn throttle_time_ms(&self) -> u32 {
169 self.throttle_time_ms
170 }
171
172 pub fn into_resources(self) -> Vec<DescribeConfigResourceResult> {
174 self.resources
175 }
176}
177
178#[derive(Clone, Copy, Debug, Eq, PartialEq)]
180pub enum DescribeConfigsFailureKind {
181 DeadlineElapsed,
183 DriverRejected,
185 Transport,
187 InvalidResponse,
189 ResponseTooLarge,
191 Compatibility,
193}
194
195#[derive(Clone, Copy, Debug, Eq, PartialEq)]
197pub struct DescribeConfigsFailure {
198 pub(super) kind: DescribeConfigsFailureKind,
199 pub(super) delivery: DescribeConfigsDeliveryStatus,
200}
201
202impl DescribeConfigsFailure {
203 pub const fn kind(self) -> DescribeConfigsFailureKind {
205 self.kind
206 }
207
208 pub const fn delivery(self) -> DescribeConfigsDeliveryStatus {
210 self.delivery
211 }
212}
213
214#[derive(Clone, Debug, Eq, PartialEq)]
216pub enum DescribeConfigsOutcome {
217 Configs(DescribeConfigsBatch),
219 Failed(DescribeConfigsFailure),
221}