1use crate::{base::status::Status, serial::request_message::RequestMessage};
2
3
4
5pub struct ChannelEvent {
6 pub channel_ip: String,
7 pub channel_id: i64,
8 pub is_active: bool,
9 pub(crate) cached_size: protobuf::rt::CachedSize,
10}
11
12pub struct TransferdFileInfo {
13 pub file_path: String,
14 pub file_size: u64,
15 pub key: String,
16 pub file_url: String,
17 pub(crate) cached_size: protobuf::rt::CachedSize,
18}
19
20pub struct LoadServiceRequest {
21 pub dxc_name: String,
22 pub dxc_version: String,
23 pub service_name: String,
24 pub only_build_ipc: bool,
25 pub config: String,
26 pub(crate) cached_size: protobuf::rt::CachedSize,
27}
28
29pub struct ConnIds {
30 pub conn_id: Vec<i64>,
31 pub(crate) cached_size: protobuf::rt::CachedSize,
32}
33
34pub struct ServiceInfo {
35 pub dxc_name: String,
36 pub dxc_version: String,
37 pub service_name: String,
38 pub md5: String,
39 pub service_id: i64,
40 pub online_time: i64,
41 pub(crate) cached_size: protobuf::rt::CachedSize,
42}
43
44pub struct GenIDResponse {
45 pub id: i64,
46 pub(crate) cached_size: protobuf::rt::CachedSize,
47}
48
49pub struct DXCProtocolHeader {
50 pub sender_key: ServiceKey,
51 pub receive_key: ServiceKey,
52 pub from_address: String,
53 pub dxc_id: String,
54 pub dxc_version: String,
55 pub channel_id: i64,
56 pub conn_id: i64,
57 pub request_id: i64,
58 pub timeout: u32,
59 pub msg_type: i32,
60 pub(crate) cached_size: protobuf::rt::CachedSize,
61}
62
63pub struct MessageInfo {
64 pub node_addr: String,
65 pub node_ip: String,
66 pub dxc_addr: String,
67 pub(crate) cached_size: protobuf::rt::CachedSize,
68}
69
70pub struct ServiceInfos {
71 pub service_infos: Vec<ServiceInfo>,
72 pub(crate) cached_size: protobuf::rt::CachedSize,
73}
74
75pub struct HttpRequest {
76 pub method: Option<HTTPMethod>,
77 pub url: String,
78 pub headers: std::collections::HashMap<String, String>,
79 pub body: String,
80 pub(crate) cached_size: protobuf::rt::CachedSize,
81}
82
83pub struct UnloadServiceRequest {
84 pub dxc_name: String,
85 pub dxc_version: String,
86 pub service_name: String,
87 pub(crate) cached_size: protobuf::rt::CachedSize,
88}
89
90pub struct VerifyInfo {
91 pub from_address: String,
92 pub dxc_id: String,
93 pub dxc_version: String,
94 pub api: String,
95 pub(crate) cached_size: protobuf::rt::CachedSize,
96}
97
98#[derive(Clone, Copy, Debug)]
99pub enum HTTPMethod {
100 GET = 0,
101 POST = 1,
102}
103
104pub struct U64Response {
105 pub value: u64,
106 pub(crate) cached_size: protobuf::rt::CachedSize,
107}
108
109pub struct DBExecuteResult {
110 pub last_insert_id: u64,
111 pub affected_rows: u64,
112 pub(crate) cached_size: protobuf::rt::CachedSize,
113}
114
115pub struct ChannelId {
116 pub channel_id: Option<i64>,
117 pub(crate) cached_size: protobuf::rt::CachedSize,
118}
119
120pub struct BoolResponse {
121 pub is_exist: bool,
122 pub(crate) cached_size: protobuf::rt::CachedSize,
123}
124
125pub struct ServiceKey {
126 pub dxc_id: String,
127 pub dxc_name: String,
128 pub dxc_version: String,
129 pub service_name: String,
130 pub(crate) cached_size: protobuf::rt::CachedSize,
131}
132
133pub struct DXCDSLInfo {
134 pub md5: String,
135 pub dsl: String,
136 pub(crate) cached_size: protobuf::rt::CachedSize,
137}
138
139pub struct StringResponse {
140 pub value: String,
141 pub(crate) cached_size: protobuf::rt::CachedSize,
142}
143
144pub struct HttpResponse {
145 pub headers: std::collections::HashMap<String, String>,
146 pub(crate) cached_size: protobuf::rt::CachedSize,
147}
148
149impl std::fmt::Debug for UnloadServiceRequest {
150fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
151f.debug_struct("UnloadServiceRequest").field("dxc_name", &self.dxc_name)
152.field("dxc_version", &self.dxc_version)
153.field("service_name", &self.service_name)
154 .finish()
155}
156}
157
158impl Default for UnloadServiceRequest {
159 fn default() -> Self {
160 UnloadServiceRequest{
161 dxc_name: String::default(),
162 dxc_version: String::default(),
163 service_name: String::default(),
164 cached_size: protobuf::rt::CachedSize::new(),
165 }
166 }
167
168}
169
170impl RequestMessage for UnloadServiceRequest {
171 fn compute_size(&self) -> u64 {
172 let mut my_size = 0;
173 if !self.dxc_name.is_empty() {
174 my_size += protobuf::rt::string_size(1, &self.dxc_name);
175 }
176 if !self.dxc_version.is_empty() {
177 my_size += protobuf::rt::string_size(2, &self.dxc_version);
178 }
179 if !self.service_name.is_empty() {
180 my_size += protobuf::rt::string_size(3, &self.service_name);
181 }
182 self.cached_size.set(my_size as u32);
183 my_size
184 }
185
186 fn serial_with_output_stream(&self, os: &mut protobuf::CodedOutputStream<'_>) -> Result<(), Status> {
187 if !self.dxc_name.is_empty() {
188 os.write_string(1, &self.dxc_name).unwrap();
189 }
190 if !self.dxc_version.is_empty() {
191 os.write_string(2, &self.dxc_version).unwrap();
192 }
193 if !self.service_name.is_empty() {
194 os.write_string(3, &self.service_name).unwrap();
195 }
196 Ok(())
197 }
198
199 fn parse_from_input_stream(&mut self, is: &mut protobuf::CodedInputStream<'_>) -> Result<(), Status> {
200 while let Some(tag) = is.read_raw_tag_or_eof().unwrap() {
201 match tag {
202 10 => {
203 self.dxc_name = is.read_string().unwrap();
204 },
205 18 => {
206 self.dxc_version = is.read_string().unwrap();
207 },
208 26 => {
209 self.service_name = is.read_string().unwrap();
210 },
211 _ => {}
212 }
213 }
214 Ok(())
215 }
216
217}
218
219impl std::fmt::Debug for HttpRequest {
220fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
221f.debug_struct("HttpRequest").field("method", &self.method)
222.field("url", &self.url)
223.field("headers", &self.headers)
224.field("body", &self.body)
225 .finish()
226}
227}
228
229impl Default for HttpRequest {
230 fn default() -> Self {
231 HttpRequest{
232 method: HTTPMethod::from_i32(0),
233 url: String::default(),
234 headers: std::collections::HashMap::new(),
235 body: String::default(),
236 cached_size: protobuf::rt::CachedSize::new(),
237 }
238 }
239
240}
241
242impl RequestMessage for HttpRequest {
243 fn compute_size(&self) -> u64 {
244 let mut my_size = 0;
245 if let Some(value) = self.method.as_ref() {
246 my_size += protobuf::rt::int32_size(1, *value as i32);
247 }
248 if !self.url.is_empty() {
249 my_size += protobuf::rt::string_size(2, &self.url);
250 }
251 for (k, v) in &self.headers {
252 let mut entry_size = 0;
253 entry_size += protobuf::rt::string_size(1, &k);
254 entry_size += protobuf::rt::string_size(2, &v);
255 my_size += 1 + protobuf::rt::compute_raw_varint64_size(entry_size) + entry_size;
256 }
257 if !self.body.is_empty() {
258 my_size += protobuf::rt::string_size(4, &self.body);
259 }
260 self.cached_size.set(my_size as u32);
261 my_size
262 }
263
264 fn serial_with_output_stream(&self, os: &mut protobuf::CodedOutputStream<'_>) -> Result<(), Status> {
265 if let Some(value) = self.method.as_ref() {
266 os.write_enum(1, *value as i32).unwrap();
267 }
268 if !self.url.is_empty() {
269 os.write_string(2, &self.url).unwrap();
270 }
271 for (k, v) in &self.headers {
272 let mut entry_size = 0;
273 entry_size += protobuf::rt::string_size(1, &k);
274 entry_size += protobuf::rt::string_size(2, &v);
275 os.write_raw_varint32(26).unwrap();
276 os.write_raw_varint32(entry_size as u32).unwrap();
277 os.write_string(1, &k).unwrap();
278 os.write_string(2, &v).unwrap();
279 }
280 if !self.body.is_empty() {
281 os.write_string(4, &self.body).unwrap();
282 }
283 Ok(())
284 }
285
286 fn parse_from_input_stream(&mut self, is: &mut protobuf::CodedInputStream<'_>) -> Result<(), Status> {
287 while let Some(tag) = is.read_raw_tag_or_eof().unwrap() {
288 match tag {
289 8 => {
290 let value = HTTPMethod::from_i32(is.read_int32().unwrap());
291 self.method = value;
292 },
293 18 => {
294 self.url = is.read_string().unwrap();
295 },
296 26 => {
297 let len = is.read_raw_varint32();
298 let len = len.unwrap();
299 let old_limit = is.push_limit(len as u64).unwrap();
300 let mut key = String::default();
301 let mut value = String::default();
302 while let Some(tag) = is.read_raw_tag_or_eof().unwrap() {
303 match tag {
304 10 => {
305 key = is.read_string().unwrap();
306 },
307 18 => {
308 value = is.read_string().unwrap();
309 },
310 _ => protobuf::rt::skip_field_for_tag(tag, is).unwrap(),
311 }
312 }
313 is.pop_limit(old_limit);
314 self.headers.insert(key, value);
315 },
316 34 => {
317 self.body = is.read_string().unwrap();
318 },
319 _ => {}
320 }
321 }
322 Ok(())
323 }
324
325}
326
327impl std::fmt::Debug for StringResponse {
328fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
329f.debug_struct("StringResponse").field("value", &self.value)
330 .finish()
331}
332}
333
334impl Default for StringResponse {
335 fn default() -> Self {
336 StringResponse{
337 value: String::default(),
338 cached_size: protobuf::rt::CachedSize::new(),
339 }
340 }
341
342}
343
344impl RequestMessage for StringResponse {
345 fn compute_size(&self) -> u64 {
346 let mut my_size = 0;
347 if !self.value.is_empty() {
348 my_size += protobuf::rt::string_size(1, &self.value);
349 }
350 self.cached_size.set(my_size as u32);
351 my_size
352 }
353
354 fn serial_with_output_stream(&self, os: &mut protobuf::CodedOutputStream<'_>) -> Result<(), Status> {
355 if !self.value.is_empty() {
356 os.write_string(1, &self.value).unwrap();
357 }
358 Ok(())
359 }
360
361 fn parse_from_input_stream(&mut self, is: &mut protobuf::CodedInputStream<'_>) -> Result<(), Status> {
362 while let Some(tag) = is.read_raw_tag_or_eof().unwrap() {
363 match tag {
364 10 => {
365 self.value = is.read_string().unwrap();
366 },
367 _ => {}
368 }
369 }
370 Ok(())
371 }
372
373}
374
375impl std::fmt::Debug for ChannelEvent {
376fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
377f.debug_struct("ChannelEvent").field("channel_ip", &self.channel_ip)
378.field("channel_id", &self.channel_id)
379.field("is_active", &self.is_active)
380 .finish()
381}
382}
383
384impl Default for ChannelEvent {
385 fn default() -> Self {
386 ChannelEvent{
387 channel_ip: String::default(),
388 channel_id: 0,
389 is_active: false,
390 cached_size: protobuf::rt::CachedSize::new(),
391 }
392 }
393
394}
395
396impl RequestMessage for ChannelEvent {
397 fn compute_size(&self) -> u64 {
398 let mut my_size = 0;
399 if !self.channel_ip.is_empty() {
400 my_size += protobuf::rt::string_size(1, &self.channel_ip);
401 }
402 if self.channel_id != 0 {
403 my_size += protobuf::rt::int64_size(2, self.channel_id);
404 }
405 if self.is_active != false {
406 my_size += 2;
407 }
408 self.cached_size.set(my_size as u32);
409 my_size
410 }
411
412 fn serial_with_output_stream(&self, os: &mut protobuf::CodedOutputStream<'_>) -> Result<(), Status> {
413 if !self.channel_ip.is_empty() {
414 os.write_string(1, &self.channel_ip).unwrap();
415 }
416 if self.channel_id != 0 {
417 os.write_int64(2, self.channel_id).unwrap();
418 }
419 if self.is_active != false {
420 os.write_bool(3, self.is_active).unwrap();
421 }
422 Ok(())
423 }
424
425 fn parse_from_input_stream(&mut self, is: &mut protobuf::CodedInputStream<'_>) -> Result<(), Status> {
426 while let Some(tag) = is.read_raw_tag_or_eof().unwrap() {
427 match tag {
428 10 => {
429 self.channel_ip = is.read_string().unwrap();
430 },
431 16 => {
432 self.channel_id = is.read_int64().unwrap();
433 },
434 24 => {
435 self.is_active = is.read_bool().unwrap();
436 },
437 _ => {}
438 }
439 }
440 Ok(())
441 }
442
443}
444
445impl std::fmt::Debug for DBExecuteResult {
446fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
447f.debug_struct("DBExecuteResult").field("last_insert_id", &self.last_insert_id)
448.field("affected_rows", &self.affected_rows)
449 .finish()
450}
451}
452
453impl Default for DBExecuteResult {
454 fn default() -> Self {
455 DBExecuteResult{
456 last_insert_id: 0,
457 affected_rows: 0,
458 cached_size: protobuf::rt::CachedSize::new(),
459 }
460 }
461
462}
463
464impl RequestMessage for DBExecuteResult {
465 fn compute_size(&self) -> u64 {
466 let mut my_size = 0;
467 if self.last_insert_id != 0 {
468 my_size += protobuf::rt::uint64_size(1, self.last_insert_id);
469 }
470 if self.affected_rows != 0 {
471 my_size += protobuf::rt::uint64_size(2, self.affected_rows);
472 }
473 self.cached_size.set(my_size as u32);
474 my_size
475 }
476
477 fn serial_with_output_stream(&self, os: &mut protobuf::CodedOutputStream<'_>) -> Result<(), Status> {
478 if self.last_insert_id != 0 {
479 os.write_uint64(1, self.last_insert_id).unwrap();
480 }
481 if self.affected_rows != 0 {
482 os.write_uint64(2, self.affected_rows).unwrap();
483 }
484 Ok(())
485 }
486
487 fn parse_from_input_stream(&mut self, is: &mut protobuf::CodedInputStream<'_>) -> Result<(), Status> {
488 while let Some(tag) = is.read_raw_tag_or_eof().unwrap() {
489 match tag {
490 8 => {
491 self.last_insert_id = is.read_uint64().unwrap();
492 },
493 16 => {
494 self.affected_rows = is.read_uint64().unwrap();
495 },
496 _ => {}
497 }
498 }
499 Ok(())
500 }
501
502}
503
504impl std::fmt::Debug for TransferdFileInfo {
505fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
506f.debug_struct("TransferdFileInfo").field("file_path", &self.file_path)
507.field("file_size", &self.file_size)
508.field("key", &self.key)
509.field("file_url", &self.file_url)
510 .finish()
511}
512}
513
514impl Default for TransferdFileInfo {
515 fn default() -> Self {
516 TransferdFileInfo{
517 file_path: String::default(),
518 file_size: 0,
519 key: String::default(),
520 file_url: String::default(),
521 cached_size: protobuf::rt::CachedSize::new(),
522 }
523 }
524
525}
526
527impl RequestMessage for TransferdFileInfo {
528 fn compute_size(&self) -> u64 {
529 let mut my_size = 0;
530 if !self.file_path.is_empty() {
531 my_size += protobuf::rt::string_size(1, &self.file_path);
532 }
533 if self.file_size != 0 {
534 my_size += protobuf::rt::uint64_size(2, self.file_size);
535 }
536 if !self.key.is_empty() {
537 my_size += protobuf::rt::string_size(3, &self.key);
538 }
539 if !self.file_url.is_empty() {
540 my_size += protobuf::rt::string_size(4, &self.file_url);
541 }
542 self.cached_size.set(my_size as u32);
543 my_size
544 }
545
546 fn serial_with_output_stream(&self, os: &mut protobuf::CodedOutputStream<'_>) -> Result<(), Status> {
547 if !self.file_path.is_empty() {
548 os.write_string(1, &self.file_path).unwrap();
549 }
550 if self.file_size != 0 {
551 os.write_uint64(2, self.file_size).unwrap();
552 }
553 if !self.key.is_empty() {
554 os.write_string(3, &self.key).unwrap();
555 }
556 if !self.file_url.is_empty() {
557 os.write_string(4, &self.file_url).unwrap();
558 }
559 Ok(())
560 }
561
562 fn parse_from_input_stream(&mut self, is: &mut protobuf::CodedInputStream<'_>) -> Result<(), Status> {
563 while let Some(tag) = is.read_raw_tag_or_eof().unwrap() {
564 match tag {
565 10 => {
566 self.file_path = is.read_string().unwrap();
567 },
568 16 => {
569 self.file_size = is.read_uint64().unwrap();
570 },
571 26 => {
572 self.key = is.read_string().unwrap();
573 },
574 34 => {
575 self.file_url = is.read_string().unwrap();
576 },
577 _ => {}
578 }
579 }
580 Ok(())
581 }
582
583}
584
585impl std::fmt::Debug for ServiceInfos {
586fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
587f.debug_struct("ServiceInfos").field("service_infos", &self.service_infos)
588 .finish()
589}
590}
591
592impl Default for ServiceInfos {
593 fn default() -> Self {
594 ServiceInfos{
595 service_infos: Vec::new(),
596 cached_size: protobuf::rt::CachedSize::new(),
597 }
598 }
599
600}
601
602impl RequestMessage for ServiceInfos {
603 fn compute_size(&self) -> u64 {
604 let mut my_size = 0;
605 for value in &self.service_infos {
606 let len = value.compute_size();
607 my_size += 1 + protobuf::rt::compute_raw_varint64_size(len) + len;
608 }
609 self.cached_size.set(my_size as u32);
610 my_size
611 }
612
613 fn serial_with_output_stream(&self, os: &mut protobuf::CodedOutputStream<'_>) -> Result<(), Status> {
614 for v in &self.service_infos {
615 os.write_tag(1, protobuf::rt::WireType::LengthDelimited).unwrap();
616 os.write_raw_varint32(v.cached_size.get() as u32).unwrap();
617 v.serial_with_output_stream(os).unwrap();
618 }
619 Ok(())
620 }
621
622 fn parse_from_input_stream(&mut self, is: &mut protobuf::CodedInputStream<'_>) -> Result<(), Status> {
623 while let Some(tag) = is.read_raw_tag_or_eof().unwrap() {
624 match tag {
625 10 => {
626 let len = is.read_raw_varint64();
627 let len = len.unwrap();
628 let old_limit = is.push_limit(len);
629 let old_limit = old_limit.unwrap();
630 let mut value = ServiceInfo::default();
631 value.parse_from_input_stream(is)?;
632 self.service_infos.push(value);
633 is.pop_limit(old_limit);
634 },
635 _ => {}
636 }
637 }
638 Ok(())
639 }
640
641}
642
643impl std::fmt::Debug for DXCProtocolHeader {
644fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
645f.debug_struct("DXCProtocolHeader").field("sender_key", &self.sender_key)
646.field("receive_key", &self.receive_key)
647.field("from_address", &self.from_address)
648.field("dxc_id", &self.dxc_id)
649.field("dxc_version", &self.dxc_version)
650.field("channel_id", &self.channel_id)
651.field("conn_id", &self.conn_id)
652.field("request_id", &self.request_id)
653.field("timeout", &self.timeout)
654.field("msg_type", &self.msg_type)
655 .finish()
656}
657}
658
659impl Default for DXCProtocolHeader {
660 fn default() -> Self {
661 DXCProtocolHeader{
662 sender_key: ServiceKey::default(),
663 receive_key: ServiceKey::default(),
664 from_address: String::default(),
665 dxc_id: String::default(),
666 dxc_version: String::default(),
667 channel_id: 0,
668 conn_id: 0,
669 request_id: 0,
670 timeout: 0,
671 msg_type: 0,
672 cached_size: protobuf::rt::CachedSize::new(),
673 }
674 }
675
676}
677
678impl RequestMessage for DXCProtocolHeader {
679 fn compute_size(&self) -> u64 {
680 let mut my_size = 0;
681 {
682 let len = self.sender_key.compute_size();
683 my_size += 1 + protobuf::rt::compute_raw_varint64_size(len) + len;
684 }
685 {
686 let len = self.receive_key.compute_size();
687 my_size += 1 + protobuf::rt::compute_raw_varint64_size(len) + len;
688 }
689 if !self.from_address.is_empty() {
690 my_size += protobuf::rt::string_size(3, &self.from_address);
691 }
692 if !self.dxc_id.is_empty() {
693 my_size += protobuf::rt::string_size(4, &self.dxc_id);
694 }
695 if !self.dxc_version.is_empty() {
696 my_size += protobuf::rt::string_size(5, &self.dxc_version);
697 }
698 if self.channel_id != 0 {
699 my_size += protobuf::rt::int64_size(6, self.channel_id);
700 }
701 if self.conn_id != 0 {
702 my_size += protobuf::rt::int64_size(7, self.conn_id);
703 }
704 if self.request_id != 0 {
705 my_size += protobuf::rt::int64_size(8, self.request_id);
706 }
707 if self.timeout != 0 {
708 my_size += protobuf::rt::uint32_size(9, self.timeout);
709 }
710 if self.msg_type != 0 {
711 my_size += protobuf::rt::int32_size(10, self.msg_type);
712 }
713 self.cached_size.set(my_size as u32);
714 my_size
715 }
716
717 fn serial_with_output_stream(&self, os: &mut protobuf::CodedOutputStream<'_>) -> Result<(), Status> {
718 {
719 os.write_tag(1, protobuf::rt::WireType::LengthDelimited).unwrap();
720 os.write_raw_varint32(self.sender_key.cached_size.get() as u32).unwrap();
721 self.sender_key.serial_with_output_stream(os).unwrap();
722 }
723 {
724 os.write_tag(2, protobuf::rt::WireType::LengthDelimited).unwrap();
725 os.write_raw_varint32(self.receive_key.cached_size.get() as u32).unwrap();
726 self.receive_key.serial_with_output_stream(os).unwrap();
727 }
728 if !self.from_address.is_empty() {
729 os.write_string(3, &self.from_address).unwrap();
730 }
731 if !self.dxc_id.is_empty() {
732 os.write_string(4, &self.dxc_id).unwrap();
733 }
734 if !self.dxc_version.is_empty() {
735 os.write_string(5, &self.dxc_version).unwrap();
736 }
737 if self.channel_id != 0 {
738 os.write_int64(6, self.channel_id).unwrap();
739 }
740 if self.conn_id != 0 {
741 os.write_int64(7, self.conn_id).unwrap();
742 }
743 if self.request_id != 0 {
744 os.write_int64(8, self.request_id).unwrap();
745 }
746 if self.timeout != 0 {
747 os.write_uint32(9, self.timeout).unwrap();
748 }
749 if self.msg_type != 0 {
750 os.write_int32(10, self.msg_type).unwrap();
751 }
752 Ok(())
753 }
754
755 fn parse_from_input_stream(&mut self, is: &mut protobuf::CodedInputStream<'_>) -> Result<(), Status> {
756 while let Some(tag) = is.read_raw_tag_or_eof().unwrap() {
757 match tag {
758 10 => {
759 let len = is.read_raw_varint64();
760 let len = len.unwrap();
761 let old_limit = is.push_limit(len);
762 let old_limit = old_limit.unwrap();
763 self.sender_key.parse_from_input_stream(is)?;
764 is.pop_limit(old_limit);
765 },
766 18 => {
767 let len = is.read_raw_varint64();
768 let len = len.unwrap();
769 let old_limit = is.push_limit(len);
770 let old_limit = old_limit.unwrap();
771 self.receive_key.parse_from_input_stream(is)?;
772 is.pop_limit(old_limit);
773 },
774 26 => {
775 self.from_address = is.read_string().unwrap();
776 },
777 34 => {
778 self.dxc_id = is.read_string().unwrap();
779 },
780 42 => {
781 self.dxc_version = is.read_string().unwrap();
782 },
783 48 => {
784 self.channel_id = is.read_int64().unwrap();
785 },
786 56 => {
787 self.conn_id = is.read_int64().unwrap();
788 },
789 64 => {
790 self.request_id = is.read_int64().unwrap();
791 },
792 72 => {
793 self.timeout = is.read_uint32().unwrap();
794 },
795 80 => {
796 self.msg_type = is.read_int32().unwrap();
797 },
798 _ => {}
799 }
800 }
801 Ok(())
802 }
803
804}
805
806impl std::fmt::Debug for VerifyInfo {
807fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
808f.debug_struct("VerifyInfo").field("from_address", &self.from_address)
809.field("dxc_id", &self.dxc_id)
810.field("dxc_version", &self.dxc_version)
811.field("api", &self.api)
812 .finish()
813}
814}
815
816impl Default for VerifyInfo {
817 fn default() -> Self {
818 VerifyInfo{
819 from_address: String::default(),
820 dxc_id: String::default(),
821 dxc_version: String::default(),
822 api: String::default(),
823 cached_size: protobuf::rt::CachedSize::new(),
824 }
825 }
826
827}
828
829impl RequestMessage for VerifyInfo {
830 fn compute_size(&self) -> u64 {
831 let mut my_size = 0;
832 if !self.from_address.is_empty() {
833 my_size += protobuf::rt::string_size(1, &self.from_address);
834 }
835 if !self.dxc_id.is_empty() {
836 my_size += protobuf::rt::string_size(2, &self.dxc_id);
837 }
838 if !self.dxc_version.is_empty() {
839 my_size += protobuf::rt::string_size(3, &self.dxc_version);
840 }
841 if !self.api.is_empty() {
842 my_size += protobuf::rt::string_size(4, &self.api);
843 }
844 self.cached_size.set(my_size as u32);
845 my_size
846 }
847
848 fn serial_with_output_stream(&self, os: &mut protobuf::CodedOutputStream<'_>) -> Result<(), Status> {
849 if !self.from_address.is_empty() {
850 os.write_string(1, &self.from_address).unwrap();
851 }
852 if !self.dxc_id.is_empty() {
853 os.write_string(2, &self.dxc_id).unwrap();
854 }
855 if !self.dxc_version.is_empty() {
856 os.write_string(3, &self.dxc_version).unwrap();
857 }
858 if !self.api.is_empty() {
859 os.write_string(4, &self.api).unwrap();
860 }
861 Ok(())
862 }
863
864 fn parse_from_input_stream(&mut self, is: &mut protobuf::CodedInputStream<'_>) -> Result<(), Status> {
865 while let Some(tag) = is.read_raw_tag_or_eof().unwrap() {
866 match tag {
867 10 => {
868 self.from_address = is.read_string().unwrap();
869 },
870 18 => {
871 self.dxc_id = is.read_string().unwrap();
872 },
873 26 => {
874 self.dxc_version = is.read_string().unwrap();
875 },
876 34 => {
877 self.api = is.read_string().unwrap();
878 },
879 _ => {}
880 }
881 }
882 Ok(())
883 }
884
885}
886
887impl std::fmt::Debug for BoolResponse {
888fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
889f.debug_struct("BoolResponse").field("is_exist", &self.is_exist)
890 .finish()
891}
892}
893
894impl Default for BoolResponse {
895 fn default() -> Self {
896 BoolResponse{
897 is_exist: false,
898 cached_size: protobuf::rt::CachedSize::new(),
899 }
900 }
901
902}
903
904impl RequestMessage for BoolResponse {
905 fn compute_size(&self) -> u64 {
906 let mut my_size = 0;
907 if self.is_exist != false {
908 my_size += 2;
909 }
910 self.cached_size.set(my_size as u32);
911 my_size
912 }
913
914 fn serial_with_output_stream(&self, os: &mut protobuf::CodedOutputStream<'_>) -> Result<(), Status> {
915 if self.is_exist != false {
916 os.write_bool(1, self.is_exist).unwrap();
917 }
918 Ok(())
919 }
920
921 fn parse_from_input_stream(&mut self, is: &mut protobuf::CodedInputStream<'_>) -> Result<(), Status> {
922 while let Some(tag) = is.read_raw_tag_or_eof().unwrap() {
923 match tag {
924 8 => {
925 self.is_exist = is.read_bool().unwrap();
926 },
927 _ => {}
928 }
929 }
930 Ok(())
931 }
932
933}
934
935impl std::fmt::Debug for MessageInfo {
936fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
937f.debug_struct("MessageInfo").field("node_addr", &self.node_addr)
938.field("node_ip", &self.node_ip)
939.field("dxc_addr", &self.dxc_addr)
940 .finish()
941}
942}
943
944impl Default for MessageInfo {
945 fn default() -> Self {
946 MessageInfo{
947 node_addr: String::default(),
948 node_ip: String::default(),
949 dxc_addr: String::default(),
950 cached_size: protobuf::rt::CachedSize::new(),
951 }
952 }
953
954}
955
956impl RequestMessage for MessageInfo {
957 fn compute_size(&self) -> u64 {
958 let mut my_size = 0;
959 if !self.node_addr.is_empty() {
960 my_size += protobuf::rt::string_size(1, &self.node_addr);
961 }
962 if !self.node_ip.is_empty() {
963 my_size += protobuf::rt::string_size(2, &self.node_ip);
964 }
965 if !self.dxc_addr.is_empty() {
966 my_size += protobuf::rt::string_size(3, &self.dxc_addr);
967 }
968 self.cached_size.set(my_size as u32);
969 my_size
970 }
971
972 fn serial_with_output_stream(&self, os: &mut protobuf::CodedOutputStream<'_>) -> Result<(), Status> {
973 if !self.node_addr.is_empty() {
974 os.write_string(1, &self.node_addr).unwrap();
975 }
976 if !self.node_ip.is_empty() {
977 os.write_string(2, &self.node_ip).unwrap();
978 }
979 if !self.dxc_addr.is_empty() {
980 os.write_string(3, &self.dxc_addr).unwrap();
981 }
982 Ok(())
983 }
984
985 fn parse_from_input_stream(&mut self, is: &mut protobuf::CodedInputStream<'_>) -> Result<(), Status> {
986 while let Some(tag) = is.read_raw_tag_or_eof().unwrap() {
987 match tag {
988 10 => {
989 self.node_addr = is.read_string().unwrap();
990 },
991 18 => {
992 self.node_ip = is.read_string().unwrap();
993 },
994 26 => {
995 self.dxc_addr = is.read_string().unwrap();
996 },
997 _ => {}
998 }
999 }
1000 Ok(())
1001 }
1002
1003}
1004
1005impl std::fmt::Debug for ServiceKey {
1006fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1007f.debug_struct("ServiceKey").field("dxc_id", &self.dxc_id)
1008.field("dxc_name", &self.dxc_name)
1009.field("dxc_version", &self.dxc_version)
1010.field("service_name", &self.service_name)
1011 .finish()
1012}
1013}
1014
1015impl Default for ServiceKey {
1016 fn default() -> Self {
1017 ServiceKey{
1018 dxc_id: String::default(),
1019 dxc_name: String::default(),
1020 dxc_version: String::default(),
1021 service_name: String::default(),
1022 cached_size: protobuf::rt::CachedSize::new(),
1023 }
1024 }
1025
1026}
1027
1028impl RequestMessage for ServiceKey {
1029 fn compute_size(&self) -> u64 {
1030 let mut my_size = 0;
1031 if !self.dxc_id.is_empty() {
1032 my_size += protobuf::rt::string_size(1, &self.dxc_id);
1033 }
1034 if !self.dxc_name.is_empty() {
1035 my_size += protobuf::rt::string_size(2, &self.dxc_name);
1036 }
1037 if !self.dxc_version.is_empty() {
1038 my_size += protobuf::rt::string_size(3, &self.dxc_version);
1039 }
1040 if !self.service_name.is_empty() {
1041 my_size += protobuf::rt::string_size(4, &self.service_name);
1042 }
1043 self.cached_size.set(my_size as u32);
1044 my_size
1045 }
1046
1047 fn serial_with_output_stream(&self, os: &mut protobuf::CodedOutputStream<'_>) -> Result<(), Status> {
1048 if !self.dxc_id.is_empty() {
1049 os.write_string(1, &self.dxc_id).unwrap();
1050 }
1051 if !self.dxc_name.is_empty() {
1052 os.write_string(2, &self.dxc_name).unwrap();
1053 }
1054 if !self.dxc_version.is_empty() {
1055 os.write_string(3, &self.dxc_version).unwrap();
1056 }
1057 if !self.service_name.is_empty() {
1058 os.write_string(4, &self.service_name).unwrap();
1059 }
1060 Ok(())
1061 }
1062
1063 fn parse_from_input_stream(&mut self, is: &mut protobuf::CodedInputStream<'_>) -> Result<(), Status> {
1064 while let Some(tag) = is.read_raw_tag_or_eof().unwrap() {
1065 match tag {
1066 10 => {
1067 self.dxc_id = is.read_string().unwrap();
1068 },
1069 18 => {
1070 self.dxc_name = is.read_string().unwrap();
1071 },
1072 26 => {
1073 self.dxc_version = is.read_string().unwrap();
1074 },
1075 34 => {
1076 self.service_name = is.read_string().unwrap();
1077 },
1078 _ => {}
1079 }
1080 }
1081 Ok(())
1082 }
1083
1084}
1085
1086impl std::fmt::Debug for HttpResponse {
1087fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1088f.debug_struct("HttpResponse").field("headers", &self.headers)
1089 .finish()
1090}
1091}
1092
1093impl Default for HttpResponse {
1094 fn default() -> Self {
1095 HttpResponse{
1096 headers: std::collections::HashMap::new(),
1097 cached_size: protobuf::rt::CachedSize::new(),
1098 }
1099 }
1100
1101}
1102
1103impl RequestMessage for HttpResponse {
1104 fn compute_size(&self) -> u64 {
1105 let mut my_size = 0;
1106 for (k, v) in &self.headers {
1107 let mut entry_size = 0;
1108 entry_size += protobuf::rt::string_size(1, &k);
1109 entry_size += protobuf::rt::string_size(2, &v);
1110 my_size += 1 + protobuf::rt::compute_raw_varint64_size(entry_size) + entry_size;
1111 }
1112 self.cached_size.set(my_size as u32);
1113 my_size
1114 }
1115
1116 fn serial_with_output_stream(&self, os: &mut protobuf::CodedOutputStream<'_>) -> Result<(), Status> {
1117 for (k, v) in &self.headers {
1118 let mut entry_size = 0;
1119 entry_size += protobuf::rt::string_size(1, &k);
1120 entry_size += protobuf::rt::string_size(2, &v);
1121 os.write_raw_varint32(10).unwrap();
1122 os.write_raw_varint32(entry_size as u32).unwrap();
1123 os.write_string(1, &k).unwrap();
1124 os.write_string(2, &v).unwrap();
1125 }
1126 Ok(())
1127 }
1128
1129 fn parse_from_input_stream(&mut self, is: &mut protobuf::CodedInputStream<'_>) -> Result<(), Status> {
1130 while let Some(tag) = is.read_raw_tag_or_eof().unwrap() {
1131 match tag {
1132 10 => {
1133 let len = is.read_raw_varint32();
1134 let len = len.unwrap();
1135 let old_limit = is.push_limit(len as u64).unwrap();
1136 let mut key = String::default();
1137 let mut value = String::default();
1138 while let Some(tag) = is.read_raw_tag_or_eof().unwrap() {
1139 match tag {
1140 10 => {
1141 key = is.read_string().unwrap();
1142 },
1143 18 => {
1144 value = is.read_string().unwrap();
1145 },
1146 _ => protobuf::rt::skip_field_for_tag(tag, is).unwrap(),
1147 }
1148 }
1149 is.pop_limit(old_limit);
1150 self.headers.insert(key, value);
1151 },
1152 _ => {}
1153 }
1154 }
1155 Ok(())
1156 }
1157
1158}
1159
1160impl std::fmt::Debug for U64Response {
1161fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1162f.debug_struct("U64Response").field("value", &self.value)
1163 .finish()
1164}
1165}
1166
1167impl Default for U64Response {
1168 fn default() -> Self {
1169 U64Response{
1170 value: 0,
1171 cached_size: protobuf::rt::CachedSize::new(),
1172 }
1173 }
1174
1175}
1176
1177impl RequestMessage for U64Response {
1178 fn compute_size(&self) -> u64 {
1179 let mut my_size = 0;
1180 if self.value != 0 {
1181 my_size += protobuf::rt::uint64_size(1, self.value);
1182 }
1183 self.cached_size.set(my_size as u32);
1184 my_size
1185 }
1186
1187 fn serial_with_output_stream(&self, os: &mut protobuf::CodedOutputStream<'_>) -> Result<(), Status> {
1188 if self.value != 0 {
1189 os.write_uint64(1, self.value).unwrap();
1190 }
1191 Ok(())
1192 }
1193
1194 fn parse_from_input_stream(&mut self, is: &mut protobuf::CodedInputStream<'_>) -> Result<(), Status> {
1195 while let Some(tag) = is.read_raw_tag_or_eof().unwrap() {
1196 match tag {
1197 8 => {
1198 self.value = is.read_uint64().unwrap();
1199 },
1200 _ => {}
1201 }
1202 }
1203 Ok(())
1204 }
1205
1206}
1207
1208impl std::fmt::Debug for LoadServiceRequest {
1209fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1210f.debug_struct("LoadServiceRequest").field("dxc_name", &self.dxc_name)
1211.field("dxc_version", &self.dxc_version)
1212.field("service_name", &self.service_name)
1213.field("only_build_ipc", &self.only_build_ipc)
1214.field("config", &self.config)
1215 .finish()
1216}
1217}
1218
1219impl Default for LoadServiceRequest {
1220 fn default() -> Self {
1221 LoadServiceRequest{
1222 dxc_name: String::default(),
1223 dxc_version: String::default(),
1224 service_name: String::default(),
1225 only_build_ipc: false,
1226 config: String::default(),
1227 cached_size: protobuf::rt::CachedSize::new(),
1228 }
1229 }
1230
1231}
1232
1233impl RequestMessage for LoadServiceRequest {
1234 fn compute_size(&self) -> u64 {
1235 let mut my_size = 0;
1236 if !self.dxc_name.is_empty() {
1237 my_size += protobuf::rt::string_size(1, &self.dxc_name);
1238 }
1239 if !self.dxc_version.is_empty() {
1240 my_size += protobuf::rt::string_size(2, &self.dxc_version);
1241 }
1242 if !self.service_name.is_empty() {
1243 my_size += protobuf::rt::string_size(3, &self.service_name);
1244 }
1245 if self.only_build_ipc != false {
1246 my_size += 2;
1247 }
1248 if !self.config.is_empty() {
1249 my_size += protobuf::rt::string_size(5, &self.config);
1250 }
1251 self.cached_size.set(my_size as u32);
1252 my_size
1253 }
1254
1255 fn serial_with_output_stream(&self, os: &mut protobuf::CodedOutputStream<'_>) -> Result<(), Status> {
1256 if !self.dxc_name.is_empty() {
1257 os.write_string(1, &self.dxc_name).unwrap();
1258 }
1259 if !self.dxc_version.is_empty() {
1260 os.write_string(2, &self.dxc_version).unwrap();
1261 }
1262 if !self.service_name.is_empty() {
1263 os.write_string(3, &self.service_name).unwrap();
1264 }
1265 if self.only_build_ipc != false {
1266 os.write_bool(4, self.only_build_ipc).unwrap();
1267 }
1268 if !self.config.is_empty() {
1269 os.write_string(5, &self.config).unwrap();
1270 }
1271 Ok(())
1272 }
1273
1274 fn parse_from_input_stream(&mut self, is: &mut protobuf::CodedInputStream<'_>) -> Result<(), Status> {
1275 while let Some(tag) = is.read_raw_tag_or_eof().unwrap() {
1276 match tag {
1277 10 => {
1278 self.dxc_name = is.read_string().unwrap();
1279 },
1280 18 => {
1281 self.dxc_version = is.read_string().unwrap();
1282 },
1283 26 => {
1284 self.service_name = is.read_string().unwrap();
1285 },
1286 32 => {
1287 self.only_build_ipc = is.read_bool().unwrap();
1288 },
1289 42 => {
1290 self.config = is.read_string().unwrap();
1291 },
1292 _ => {}
1293 }
1294 }
1295 Ok(())
1296 }
1297
1298}
1299
1300impl std::fmt::Debug for DXCDSLInfo {
1301fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1302f.debug_struct("DXCDSLInfo").field("md5", &self.md5)
1303.field("dsl", &self.dsl)
1304 .finish()
1305}
1306}
1307
1308impl Default for DXCDSLInfo {
1309 fn default() -> Self {
1310 DXCDSLInfo{
1311 md5: String::default(),
1312 dsl: String::default(),
1313 cached_size: protobuf::rt::CachedSize::new(),
1314 }
1315 }
1316
1317}
1318
1319impl RequestMessage for DXCDSLInfo {
1320 fn compute_size(&self) -> u64 {
1321 let mut my_size = 0;
1322 if !self.md5.is_empty() {
1323 my_size += protobuf::rt::string_size(1, &self.md5);
1324 }
1325 if !self.dsl.is_empty() {
1326 my_size += protobuf::rt::string_size(2, &self.dsl);
1327 }
1328 self.cached_size.set(my_size as u32);
1329 my_size
1330 }
1331
1332 fn serial_with_output_stream(&self, os: &mut protobuf::CodedOutputStream<'_>) -> Result<(), Status> {
1333 if !self.md5.is_empty() {
1334 os.write_string(1, &self.md5).unwrap();
1335 }
1336 if !self.dsl.is_empty() {
1337 os.write_string(2, &self.dsl).unwrap();
1338 }
1339 Ok(())
1340 }
1341
1342 fn parse_from_input_stream(&mut self, is: &mut protobuf::CodedInputStream<'_>) -> Result<(), Status> {
1343 while let Some(tag) = is.read_raw_tag_or_eof().unwrap() {
1344 match tag {
1345 10 => {
1346 self.md5 = is.read_string().unwrap();
1347 },
1348 18 => {
1349 self.dsl = is.read_string().unwrap();
1350 },
1351 _ => {}
1352 }
1353 }
1354 Ok(())
1355 }
1356
1357}
1358
1359impl std::fmt::Debug for ServiceInfo {
1360fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1361f.debug_struct("ServiceInfo").field("dxc_name", &self.dxc_name)
1362.field("dxc_version", &self.dxc_version)
1363.field("service_name", &self.service_name)
1364.field("md5", &self.md5)
1365.field("service_id", &self.service_id)
1366.field("online_time", &self.online_time)
1367 .finish()
1368}
1369}
1370
1371impl Default for ServiceInfo {
1372 fn default() -> Self {
1373 ServiceInfo{
1374 dxc_name: String::default(),
1375 dxc_version: String::default(),
1376 service_name: String::default(),
1377 md5: String::default(),
1378 service_id: 0,
1379 online_time: 0,
1380 cached_size: protobuf::rt::CachedSize::new(),
1381 }
1382 }
1383
1384}
1385
1386impl RequestMessage for ServiceInfo {
1387 fn compute_size(&self) -> u64 {
1388 let mut my_size = 0;
1389 if !self.dxc_name.is_empty() {
1390 my_size += protobuf::rt::string_size(1, &self.dxc_name);
1391 }
1392 if !self.dxc_version.is_empty() {
1393 my_size += protobuf::rt::string_size(2, &self.dxc_version);
1394 }
1395 if !self.service_name.is_empty() {
1396 my_size += protobuf::rt::string_size(3, &self.service_name);
1397 }
1398 if !self.md5.is_empty() {
1399 my_size += protobuf::rt::string_size(4, &self.md5);
1400 }
1401 if self.service_id != 0 {
1402 my_size += protobuf::rt::int64_size(5, self.service_id);
1403 }
1404 if self.online_time != 0 {
1405 my_size += protobuf::rt::int64_size(6, self.online_time);
1406 }
1407 self.cached_size.set(my_size as u32);
1408 my_size
1409 }
1410
1411 fn serial_with_output_stream(&self, os: &mut protobuf::CodedOutputStream<'_>) -> Result<(), Status> {
1412 if !self.dxc_name.is_empty() {
1413 os.write_string(1, &self.dxc_name).unwrap();
1414 }
1415 if !self.dxc_version.is_empty() {
1416 os.write_string(2, &self.dxc_version).unwrap();
1417 }
1418 if !self.service_name.is_empty() {
1419 os.write_string(3, &self.service_name).unwrap();
1420 }
1421 if !self.md5.is_empty() {
1422 os.write_string(4, &self.md5).unwrap();
1423 }
1424 if self.service_id != 0 {
1425 os.write_int64(5, self.service_id).unwrap();
1426 }
1427 if self.online_time != 0 {
1428 os.write_int64(6, self.online_time).unwrap();
1429 }
1430 Ok(())
1431 }
1432
1433 fn parse_from_input_stream(&mut self, is: &mut protobuf::CodedInputStream<'_>) -> Result<(), Status> {
1434 while let Some(tag) = is.read_raw_tag_or_eof().unwrap() {
1435 match tag {
1436 10 => {
1437 self.dxc_name = is.read_string().unwrap();
1438 },
1439 18 => {
1440 self.dxc_version = is.read_string().unwrap();
1441 },
1442 26 => {
1443 self.service_name = is.read_string().unwrap();
1444 },
1445 34 => {
1446 self.md5 = is.read_string().unwrap();
1447 },
1448 40 => {
1449 self.service_id = is.read_int64().unwrap();
1450 },
1451 48 => {
1452 self.online_time = is.read_int64().unwrap();
1453 },
1454 _ => {}
1455 }
1456 }
1457 Ok(())
1458 }
1459
1460}
1461
1462impl std::fmt::Debug for ConnIds {
1463fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1464f.debug_struct("ConnIds").field("conn_id", &self.conn_id)
1465 .finish()
1466}
1467}
1468
1469impl Default for ConnIds {
1470 fn default() -> Self {
1471 ConnIds{
1472 conn_id: Vec::new(),
1473 cached_size: protobuf::rt::CachedSize::new(),
1474 }
1475 }
1476
1477}
1478
1479impl RequestMessage for ConnIds {
1480 fn compute_size(&self) -> u64 {
1481 let mut my_size = 0;
1482 for value in &self.conn_id {
1483 my_size += protobuf::rt::int64_size(1, *value);
1484 }
1485 self.cached_size.set(my_size as u32);
1486 my_size
1487 }
1488
1489 fn serial_with_output_stream(&self, os: &mut protobuf::CodedOutputStream<'_>) -> Result<(), Status> {
1490 for v in &self.conn_id {
1491 os.write_int64(1, *v).unwrap();
1492 }
1493 Ok(())
1494 }
1495
1496 fn parse_from_input_stream(&mut self, is: &mut protobuf::CodedInputStream<'_>) -> Result<(), Status> {
1497 while let Some(tag) = is.read_raw_tag_or_eof().unwrap() {
1498 match tag {
1499 8 => {
1500 self.conn_id.push(is.read_int64().unwrap());
1501 },
1502 _ => {}
1503 }
1504 }
1505 Ok(())
1506 }
1507
1508}
1509
1510impl std::fmt::Debug for ChannelId {
1511fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1512f.debug_struct("ChannelId").field("channel_id", &self.channel_id)
1513 .finish()
1514}
1515}
1516
1517impl Default for ChannelId {
1518 fn default() -> Self {
1519 ChannelId{
1520 channel_id: None,
1521 cached_size: protobuf::rt::CachedSize::new(),
1522 }
1523 }
1524
1525}
1526
1527impl RequestMessage for ChannelId {
1528 fn compute_size(&self) -> u64 {
1529 let mut my_size = 0;
1530 if let Some(v) = self.channel_id {
1531 my_size += protobuf::rt::int64_size(1, v);
1532 }
1533 self.cached_size.set(my_size as u32);
1534 my_size
1535 }
1536
1537 fn serial_with_output_stream(&self, os: &mut protobuf::CodedOutputStream<'_>) -> Result<(), Status> {
1538 if let Some(v) = self.channel_id {
1539 os.write_int64(1, v).unwrap();
1540 }
1541 Ok(())
1542 }
1543
1544 fn parse_from_input_stream(&mut self, is: &mut protobuf::CodedInputStream<'_>) -> Result<(), Status> {
1545 while let Some(tag) = is.read_raw_tag_or_eof().unwrap() {
1546 match tag {
1547 8 => {
1548 self.channel_id = Some(is.read_int64().unwrap());
1549 },
1550 _ => {}
1551 }
1552 }
1553 Ok(())
1554 }
1555
1556}
1557
1558impl std::fmt::Debug for GenIDResponse {
1559fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1560f.debug_struct("GenIDResponse").field("id", &self.id)
1561 .finish()
1562}
1563}
1564
1565impl Default for GenIDResponse {
1566 fn default() -> Self {
1567 GenIDResponse{
1568 id: 0,
1569 cached_size: protobuf::rt::CachedSize::new(),
1570 }
1571 }
1572
1573}
1574
1575impl RequestMessage for GenIDResponse {
1576 fn compute_size(&self) -> u64 {
1577 let mut my_size = 0;
1578 if self.id != 0 {
1579 my_size += protobuf::rt::int64_size(1, self.id);
1580 }
1581 self.cached_size.set(my_size as u32);
1582 my_size
1583 }
1584
1585 fn serial_with_output_stream(&self, os: &mut protobuf::CodedOutputStream<'_>) -> Result<(), Status> {
1586 if self.id != 0 {
1587 os.write_int64(1, self.id).unwrap();
1588 }
1589 Ok(())
1590 }
1591
1592 fn parse_from_input_stream(&mut self, is: &mut protobuf::CodedInputStream<'_>) -> Result<(), Status> {
1593 while let Some(tag) = is.read_raw_tag_or_eof().unwrap() {
1594 match tag {
1595 8 => {
1596 self.id = is.read_int64().unwrap();
1597 },
1598 _ => {}
1599 }
1600 }
1601 Ok(())
1602 }
1603
1604}
1605
1606impl HTTPMethod {
1607 fn from_i32(value: i32) -> Option<HTTPMethod> {
1608 match value {
1609 0 => Some(Self::GET),
1610 1 => Some(Self::POST),
1611 _ => None
1612 }
1613 }
1614
1615}
1616