1use crate::common_generated::*;
6use core::cmp::Ordering;
7use core::mem;
8
9extern crate flatbuffers;
10use self::flatbuffers::{EndianScalar, Follow};
11
12#[allow(unused_imports, dead_code)]
13pub mod client_request {
14
15 use crate::common_generated::*;
16 use core::cmp::Ordering;
17 use core::mem;
18
19 extern crate flatbuffers;
20 use self::flatbuffers::{EndianScalar, Follow};
21
22 #[deprecated(
23 since = "2.0.0",
24 note = "Use associated constants instead. This will no longer be generated in 2021."
25 )]
26 pub const ENUM_MIN_DELEGATE_TYPE: u8 = 0;
27 #[deprecated(
28 since = "2.0.0",
29 note = "Use associated constants instead. This will no longer be generated in 2021."
30 )]
31 pub const ENUM_MAX_DELEGATE_TYPE: u8 = 1;
32 #[deprecated(
33 since = "2.0.0",
34 note = "Use associated constants instead. This will no longer be generated in 2021."
35 )]
36 #[allow(non_camel_case_types)]
37 pub const ENUM_VALUES_DELEGATE_TYPE: [DelegateType; 2] =
38 [DelegateType::NONE, DelegateType::WasmDelegateV1];
39
40 #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
41 #[repr(transparent)]
42 pub struct DelegateType(pub u8);
43 #[allow(non_upper_case_globals)]
44 impl DelegateType {
45 pub const NONE: Self = Self(0);
46 pub const WasmDelegateV1: Self = Self(1);
47
48 pub const ENUM_MIN: u8 = 0;
49 pub const ENUM_MAX: u8 = 1;
50 pub const ENUM_VALUES: &'static [Self] = &[Self::NONE, Self::WasmDelegateV1];
51 pub fn variant_name(self) -> Option<&'static str> {
53 match self {
54 Self::NONE => Some("NONE"),
55 Self::WasmDelegateV1 => Some("WasmDelegateV1"),
56 _ => None,
57 }
58 }
59 }
60 impl core::fmt::Debug for DelegateType {
61 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
62 if let Some(name) = self.variant_name() {
63 f.write_str(name)
64 } else {
65 f.write_fmt(format_args!("<UNKNOWN {:?}>", self.0))
66 }
67 }
68 }
69 impl<'a> flatbuffers::Follow<'a> for DelegateType {
70 type Inner = Self;
71 #[inline]
72 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
73 let b = flatbuffers::read_scalar_at::<u8>(buf, loc);
74 Self(b)
75 }
76 }
77
78 impl flatbuffers::Push for DelegateType {
79 type Output = DelegateType;
80 #[inline]
81 unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
82 flatbuffers::emplace_scalar::<u8>(dst, self.0);
83 }
84 }
85
86 impl flatbuffers::EndianScalar for DelegateType {
87 type Scalar = u8;
88 #[inline]
89 fn to_little_endian(self) -> u8 {
90 self.0.to_le()
91 }
92 #[inline]
93 #[allow(clippy::wrong_self_convention)]
94 fn from_little_endian(v: u8) -> Self {
95 let b = u8::from_le(v);
96 Self(b)
97 }
98 }
99
100 impl<'a> flatbuffers::Verifiable for DelegateType {
101 #[inline]
102 fn run_verifier(
103 v: &mut flatbuffers::Verifier,
104 pos: usize,
105 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
106 use self::flatbuffers::Verifiable;
107 u8::run_verifier(v, pos)
108 }
109 }
110
111 impl flatbuffers::SimpleToVerifyInSlice for DelegateType {}
112 pub struct DelegateTypeUnionTableOffset {}
113
114 #[deprecated(
115 since = "2.0.0",
116 note = "Use associated constants instead. This will no longer be generated in 2021."
117 )]
118 pub const ENUM_MIN_CONTRACT_REQUEST_TYPE: u8 = 0;
119 #[deprecated(
120 since = "2.0.0",
121 note = "Use associated constants instead. This will no longer be generated in 2021."
122 )]
123 pub const ENUM_MAX_CONTRACT_REQUEST_TYPE: u8 = 4;
124 #[deprecated(
125 since = "2.0.0",
126 note = "Use associated constants instead. This will no longer be generated in 2021."
127 )]
128 #[allow(non_camel_case_types)]
129 pub const ENUM_VALUES_CONTRACT_REQUEST_TYPE: [ContractRequestType; 5] = [
130 ContractRequestType::NONE,
131 ContractRequestType::Put,
132 ContractRequestType::Update,
133 ContractRequestType::Get,
134 ContractRequestType::Subscribe,
135 ];
136
137 #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
138 #[repr(transparent)]
139 pub struct ContractRequestType(pub u8);
140 #[allow(non_upper_case_globals)]
141 impl ContractRequestType {
142 pub const NONE: Self = Self(0);
143 pub const Put: Self = Self(1);
144 pub const Update: Self = Self(2);
145 pub const Get: Self = Self(3);
146 pub const Subscribe: Self = Self(4);
147
148 pub const ENUM_MIN: u8 = 0;
149 pub const ENUM_MAX: u8 = 4;
150 pub const ENUM_VALUES: &'static [Self] = &[
151 Self::NONE,
152 Self::Put,
153 Self::Update,
154 Self::Get,
155 Self::Subscribe,
156 ];
157 pub fn variant_name(self) -> Option<&'static str> {
159 match self {
160 Self::NONE => Some("NONE"),
161 Self::Put => Some("Put"),
162 Self::Update => Some("Update"),
163 Self::Get => Some("Get"),
164 Self::Subscribe => Some("Subscribe"),
165 _ => None,
166 }
167 }
168 }
169 impl core::fmt::Debug for ContractRequestType {
170 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
171 if let Some(name) = self.variant_name() {
172 f.write_str(name)
173 } else {
174 f.write_fmt(format_args!("<UNKNOWN {:?}>", self.0))
175 }
176 }
177 }
178 impl<'a> flatbuffers::Follow<'a> for ContractRequestType {
179 type Inner = Self;
180 #[inline]
181 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
182 let b = flatbuffers::read_scalar_at::<u8>(buf, loc);
183 Self(b)
184 }
185 }
186
187 impl flatbuffers::Push for ContractRequestType {
188 type Output = ContractRequestType;
189 #[inline]
190 unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
191 flatbuffers::emplace_scalar::<u8>(dst, self.0);
192 }
193 }
194
195 impl flatbuffers::EndianScalar for ContractRequestType {
196 type Scalar = u8;
197 #[inline]
198 fn to_little_endian(self) -> u8 {
199 self.0.to_le()
200 }
201 #[inline]
202 #[allow(clippy::wrong_self_convention)]
203 fn from_little_endian(v: u8) -> Self {
204 let b = u8::from_le(v);
205 Self(b)
206 }
207 }
208
209 impl<'a> flatbuffers::Verifiable for ContractRequestType {
210 #[inline]
211 fn run_verifier(
212 v: &mut flatbuffers::Verifier,
213 pos: usize,
214 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
215 use self::flatbuffers::Verifiable;
216 u8::run_verifier(v, pos)
217 }
218 }
219
220 impl flatbuffers::SimpleToVerifyInSlice for ContractRequestType {}
221 pub struct ContractRequestTypeUnionTableOffset {}
222
223 #[deprecated(
224 since = "2.0.0",
225 note = "Use associated constants instead. This will no longer be generated in 2021."
226 )]
227 pub const ENUM_MIN_INBOUND_DELEGATE_MSG_TYPE: u8 = 0;
228 #[deprecated(
229 since = "2.0.0",
230 note = "Use associated constants instead. This will no longer be generated in 2021."
231 )]
232 pub const ENUM_MAX_INBOUND_DELEGATE_MSG_TYPE: u8 = 4;
233 #[deprecated(
234 since = "2.0.0",
235 note = "Use associated constants instead. This will no longer be generated in 2021."
236 )]
237 #[allow(non_camel_case_types)]
238 pub const ENUM_VALUES_INBOUND_DELEGATE_MSG_TYPE: [InboundDelegateMsgType; 5] = [
239 InboundDelegateMsgType::NONE,
240 InboundDelegateMsgType::common_ApplicationMessage,
241 InboundDelegateMsgType::common_GetSecretResponse,
242 InboundDelegateMsgType::UserInputResponse,
243 InboundDelegateMsgType::common_GetSecretRequest,
244 ];
245
246 #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
247 #[repr(transparent)]
248 pub struct InboundDelegateMsgType(pub u8);
249 #[allow(non_upper_case_globals)]
250 impl InboundDelegateMsgType {
251 pub const NONE: Self = Self(0);
252 pub const common_ApplicationMessage: Self = Self(1);
253 pub const common_GetSecretResponse: Self = Self(2);
254 pub const UserInputResponse: Self = Self(3);
255 pub const common_GetSecretRequest: Self = Self(4);
256
257 pub const ENUM_MIN: u8 = 0;
258 pub const ENUM_MAX: u8 = 4;
259 pub const ENUM_VALUES: &'static [Self] = &[
260 Self::NONE,
261 Self::common_ApplicationMessage,
262 Self::common_GetSecretResponse,
263 Self::UserInputResponse,
264 Self::common_GetSecretRequest,
265 ];
266 pub fn variant_name(self) -> Option<&'static str> {
268 match self {
269 Self::NONE => Some("NONE"),
270 Self::common_ApplicationMessage => Some("common_ApplicationMessage"),
271 Self::common_GetSecretResponse => Some("common_GetSecretResponse"),
272 Self::UserInputResponse => Some("UserInputResponse"),
273 Self::common_GetSecretRequest => Some("common_GetSecretRequest"),
274 _ => None,
275 }
276 }
277 }
278 impl core::fmt::Debug for InboundDelegateMsgType {
279 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
280 if let Some(name) = self.variant_name() {
281 f.write_str(name)
282 } else {
283 f.write_fmt(format_args!("<UNKNOWN {:?}>", self.0))
284 }
285 }
286 }
287 impl<'a> flatbuffers::Follow<'a> for InboundDelegateMsgType {
288 type Inner = Self;
289 #[inline]
290 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
291 let b = flatbuffers::read_scalar_at::<u8>(buf, loc);
292 Self(b)
293 }
294 }
295
296 impl flatbuffers::Push for InboundDelegateMsgType {
297 type Output = InboundDelegateMsgType;
298 #[inline]
299 unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
300 flatbuffers::emplace_scalar::<u8>(dst, self.0);
301 }
302 }
303
304 impl flatbuffers::EndianScalar for InboundDelegateMsgType {
305 type Scalar = u8;
306 #[inline]
307 fn to_little_endian(self) -> u8 {
308 self.0.to_le()
309 }
310 #[inline]
311 #[allow(clippy::wrong_self_convention)]
312 fn from_little_endian(v: u8) -> Self {
313 let b = u8::from_le(v);
314 Self(b)
315 }
316 }
317
318 impl<'a> flatbuffers::Verifiable for InboundDelegateMsgType {
319 #[inline]
320 fn run_verifier(
321 v: &mut flatbuffers::Verifier,
322 pos: usize,
323 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
324 use self::flatbuffers::Verifiable;
325 u8::run_verifier(v, pos)
326 }
327 }
328
329 impl flatbuffers::SimpleToVerifyInSlice for InboundDelegateMsgType {}
330 pub struct InboundDelegateMsgTypeUnionTableOffset {}
331
332 #[deprecated(
333 since = "2.0.0",
334 note = "Use associated constants instead. This will no longer be generated in 2021."
335 )]
336 pub const ENUM_MIN_DELEGATE_REQUEST_TYPE: u8 = 0;
337 #[deprecated(
338 since = "2.0.0",
339 note = "Use associated constants instead. This will no longer be generated in 2021."
340 )]
341 pub const ENUM_MAX_DELEGATE_REQUEST_TYPE: u8 = 4;
342 #[deprecated(
343 since = "2.0.0",
344 note = "Use associated constants instead. This will no longer be generated in 2021."
345 )]
346 #[allow(non_camel_case_types)]
347 pub const ENUM_VALUES_DELEGATE_REQUEST_TYPE: [DelegateRequestType; 5] = [
348 DelegateRequestType::NONE,
349 DelegateRequestType::ApplicationMessages,
350 DelegateRequestType::GetSecretRequestType,
351 DelegateRequestType::RegisterDelegate,
352 DelegateRequestType::UnregisterDelegate,
353 ];
354
355 #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
356 #[repr(transparent)]
357 pub struct DelegateRequestType(pub u8);
358 #[allow(non_upper_case_globals)]
359 impl DelegateRequestType {
360 pub const NONE: Self = Self(0);
361 pub const ApplicationMessages: Self = Self(1);
362 pub const GetSecretRequestType: Self = Self(2);
363 pub const RegisterDelegate: Self = Self(3);
364 pub const UnregisterDelegate: Self = Self(4);
365
366 pub const ENUM_MIN: u8 = 0;
367 pub const ENUM_MAX: u8 = 4;
368 pub const ENUM_VALUES: &'static [Self] = &[
369 Self::NONE,
370 Self::ApplicationMessages,
371 Self::GetSecretRequestType,
372 Self::RegisterDelegate,
373 Self::UnregisterDelegate,
374 ];
375 pub fn variant_name(self) -> Option<&'static str> {
377 match self {
378 Self::NONE => Some("NONE"),
379 Self::ApplicationMessages => Some("ApplicationMessages"),
380 Self::GetSecretRequestType => Some("GetSecretRequestType"),
381 Self::RegisterDelegate => Some("RegisterDelegate"),
382 Self::UnregisterDelegate => Some("UnregisterDelegate"),
383 _ => None,
384 }
385 }
386 }
387 impl core::fmt::Debug for DelegateRequestType {
388 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
389 if let Some(name) = self.variant_name() {
390 f.write_str(name)
391 } else {
392 f.write_fmt(format_args!("<UNKNOWN {:?}>", self.0))
393 }
394 }
395 }
396 impl<'a> flatbuffers::Follow<'a> for DelegateRequestType {
397 type Inner = Self;
398 #[inline]
399 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
400 let b = flatbuffers::read_scalar_at::<u8>(buf, loc);
401 Self(b)
402 }
403 }
404
405 impl flatbuffers::Push for DelegateRequestType {
406 type Output = DelegateRequestType;
407 #[inline]
408 unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
409 flatbuffers::emplace_scalar::<u8>(dst, self.0);
410 }
411 }
412
413 impl flatbuffers::EndianScalar for DelegateRequestType {
414 type Scalar = u8;
415 #[inline]
416 fn to_little_endian(self) -> u8 {
417 self.0.to_le()
418 }
419 #[inline]
420 #[allow(clippy::wrong_self_convention)]
421 fn from_little_endian(v: u8) -> Self {
422 let b = u8::from_le(v);
423 Self(b)
424 }
425 }
426
427 impl<'a> flatbuffers::Verifiable for DelegateRequestType {
428 #[inline]
429 fn run_verifier(
430 v: &mut flatbuffers::Verifier,
431 pos: usize,
432 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
433 use self::flatbuffers::Verifiable;
434 u8::run_verifier(v, pos)
435 }
436 }
437
438 impl flatbuffers::SimpleToVerifyInSlice for DelegateRequestType {}
439 pub struct DelegateRequestTypeUnionTableOffset {}
440
441 #[deprecated(
442 since = "2.0.0",
443 note = "Use associated constants instead. This will no longer be generated in 2021."
444 )]
445 pub const ENUM_MIN_CLIENT_REQUEST_TYPE: u8 = 0;
446 #[deprecated(
447 since = "2.0.0",
448 note = "Use associated constants instead. This will no longer be generated in 2021."
449 )]
450 pub const ENUM_MAX_CLIENT_REQUEST_TYPE: u8 = 4;
451 #[deprecated(
452 since = "2.0.0",
453 note = "Use associated constants instead. This will no longer be generated in 2021."
454 )]
455 #[allow(non_camel_case_types)]
456 pub const ENUM_VALUES_CLIENT_REQUEST_TYPE: [ClientRequestType; 5] = [
457 ClientRequestType::NONE,
458 ClientRequestType::ContractRequest,
459 ClientRequestType::DelegateRequest,
460 ClientRequestType::Disconnect,
461 ClientRequestType::Authenticate,
462 ];
463
464 #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
465 #[repr(transparent)]
466 pub struct ClientRequestType(pub u8);
467 #[allow(non_upper_case_globals)]
468 impl ClientRequestType {
469 pub const NONE: Self = Self(0);
470 pub const ContractRequest: Self = Self(1);
471 pub const DelegateRequest: Self = Self(2);
472 pub const Disconnect: Self = Self(3);
473 pub const Authenticate: Self = Self(4);
474
475 pub const ENUM_MIN: u8 = 0;
476 pub const ENUM_MAX: u8 = 4;
477 pub const ENUM_VALUES: &'static [Self] = &[
478 Self::NONE,
479 Self::ContractRequest,
480 Self::DelegateRequest,
481 Self::Disconnect,
482 Self::Authenticate,
483 ];
484 pub fn variant_name(self) -> Option<&'static str> {
486 match self {
487 Self::NONE => Some("NONE"),
488 Self::ContractRequest => Some("ContractRequest"),
489 Self::DelegateRequest => Some("DelegateRequest"),
490 Self::Disconnect => Some("Disconnect"),
491 Self::Authenticate => Some("Authenticate"),
492 _ => None,
493 }
494 }
495 }
496 impl core::fmt::Debug for ClientRequestType {
497 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
498 if let Some(name) = self.variant_name() {
499 f.write_str(name)
500 } else {
501 f.write_fmt(format_args!("<UNKNOWN {:?}>", self.0))
502 }
503 }
504 }
505 impl<'a> flatbuffers::Follow<'a> for ClientRequestType {
506 type Inner = Self;
507 #[inline]
508 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
509 let b = flatbuffers::read_scalar_at::<u8>(buf, loc);
510 Self(b)
511 }
512 }
513
514 impl flatbuffers::Push for ClientRequestType {
515 type Output = ClientRequestType;
516 #[inline]
517 unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
518 flatbuffers::emplace_scalar::<u8>(dst, self.0);
519 }
520 }
521
522 impl flatbuffers::EndianScalar for ClientRequestType {
523 type Scalar = u8;
524 #[inline]
525 fn to_little_endian(self) -> u8 {
526 self.0.to_le()
527 }
528 #[inline]
529 #[allow(clippy::wrong_self_convention)]
530 fn from_little_endian(v: u8) -> Self {
531 let b = u8::from_le(v);
532 Self(b)
533 }
534 }
535
536 impl<'a> flatbuffers::Verifiable for ClientRequestType {
537 #[inline]
538 fn run_verifier(
539 v: &mut flatbuffers::Verifier,
540 pos: usize,
541 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
542 use self::flatbuffers::Verifiable;
543 u8::run_verifier(v, pos)
544 }
545 }
546
547 impl flatbuffers::SimpleToVerifyInSlice for ClientRequestType {}
548 pub struct ClientRequestTypeUnionTableOffset {}
549
550 pub enum DelegateCodeOffset {}
551 #[derive(Copy, Clone, PartialEq)]
552
553 pub struct DelegateCode<'a> {
554 pub _tab: flatbuffers::Table<'a>,
555 }
556
557 impl<'a> flatbuffers::Follow<'a> for DelegateCode<'a> {
558 type Inner = DelegateCode<'a>;
559 #[inline]
560 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
561 Self {
562 _tab: flatbuffers::Table::new(buf, loc),
563 }
564 }
565 }
566
567 impl<'a> DelegateCode<'a> {
568 pub const VT_DATA: flatbuffers::VOffsetT = 4;
569 pub const VT_CODE_HASH: flatbuffers::VOffsetT = 6;
570
571 #[inline]
572 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
573 DelegateCode { _tab: table }
574 }
575 #[allow(unused_mut)]
576 pub fn create<
577 'bldr: 'args,
578 'args: 'mut_bldr,
579 'mut_bldr,
580 A: flatbuffers::Allocator + 'bldr,
581 >(
582 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
583 args: &'args DelegateCodeArgs<'args>,
584 ) -> flatbuffers::WIPOffset<DelegateCode<'bldr>> {
585 let mut builder = DelegateCodeBuilder::new(_fbb);
586 if let Some(x) = args.code_hash {
587 builder.add_code_hash(x);
588 }
589 if let Some(x) = args.data {
590 builder.add_data(x);
591 }
592 builder.finish()
593 }
594
595 #[inline]
596 pub fn data(&self) -> flatbuffers::Vector<'a, u8> {
597 unsafe {
601 self._tab
602 .get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, u8>>>(
603 DelegateCode::VT_DATA,
604 None,
605 )
606 .unwrap()
607 }
608 }
609 #[inline]
610 pub fn code_hash(&self) -> flatbuffers::Vector<'a, u8> {
611 unsafe {
615 self._tab
616 .get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, u8>>>(
617 DelegateCode::VT_CODE_HASH,
618 None,
619 )
620 .unwrap()
621 }
622 }
623 }
624
625 impl flatbuffers::Verifiable for DelegateCode<'_> {
626 #[inline]
627 fn run_verifier(
628 v: &mut flatbuffers::Verifier,
629 pos: usize,
630 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
631 use self::flatbuffers::Verifiable;
632 v.visit_table(pos)?
633 .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, u8>>>(
634 "data",
635 Self::VT_DATA,
636 true,
637 )?
638 .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, u8>>>(
639 "code_hash",
640 Self::VT_CODE_HASH,
641 true,
642 )?
643 .finish();
644 Ok(())
645 }
646 }
647 pub struct DelegateCodeArgs<'a> {
648 pub data: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, u8>>>,
649 pub code_hash: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, u8>>>,
650 }
651 impl<'a> Default for DelegateCodeArgs<'a> {
652 #[inline]
653 fn default() -> Self {
654 DelegateCodeArgs {
655 data: None, code_hash: None, }
658 }
659 }
660
661 pub struct DelegateCodeBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
662 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
663 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
664 }
665 impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> DelegateCodeBuilder<'a, 'b, A> {
666 #[inline]
667 pub fn add_data(&mut self, data: flatbuffers::WIPOffset<flatbuffers::Vector<'b, u8>>) {
668 self.fbb_
669 .push_slot_always::<flatbuffers::WIPOffset<_>>(DelegateCode::VT_DATA, data);
670 }
671 #[inline]
672 pub fn add_code_hash(
673 &mut self,
674 code_hash: flatbuffers::WIPOffset<flatbuffers::Vector<'b, u8>>,
675 ) {
676 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(
677 DelegateCode::VT_CODE_HASH,
678 code_hash,
679 );
680 }
681 #[inline]
682 pub fn new(
683 _fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
684 ) -> DelegateCodeBuilder<'a, 'b, A> {
685 let start = _fbb.start_table();
686 DelegateCodeBuilder {
687 fbb_: _fbb,
688 start_: start,
689 }
690 }
691 #[inline]
692 pub fn finish(self) -> flatbuffers::WIPOffset<DelegateCode<'a>> {
693 let o = self.fbb_.end_table(self.start_);
694 self.fbb_.required(o, DelegateCode::VT_DATA, "data");
695 self.fbb_
696 .required(o, DelegateCode::VT_CODE_HASH, "code_hash");
697 flatbuffers::WIPOffset::new(o.value())
698 }
699 }
700
701 impl core::fmt::Debug for DelegateCode<'_> {
702 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
703 let mut ds = f.debug_struct("DelegateCode");
704 ds.field("data", &self.data());
705 ds.field("code_hash", &self.code_hash());
706 ds.finish()
707 }
708 }
709 pub enum DelegateKeyOffset {}
710 #[derive(Copy, Clone, PartialEq)]
711
712 pub struct DelegateKey<'a> {
713 pub _tab: flatbuffers::Table<'a>,
714 }
715
716 impl<'a> flatbuffers::Follow<'a> for DelegateKey<'a> {
717 type Inner = DelegateKey<'a>;
718 #[inline]
719 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
720 Self {
721 _tab: flatbuffers::Table::new(buf, loc),
722 }
723 }
724 }
725
726 impl<'a> DelegateKey<'a> {
727 pub const VT_KEY: flatbuffers::VOffsetT = 4;
728 pub const VT_CODE_HASH: flatbuffers::VOffsetT = 6;
729
730 #[inline]
731 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
732 DelegateKey { _tab: table }
733 }
734 #[allow(unused_mut)]
735 pub fn create<
736 'bldr: 'args,
737 'args: 'mut_bldr,
738 'mut_bldr,
739 A: flatbuffers::Allocator + 'bldr,
740 >(
741 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
742 args: &'args DelegateKeyArgs<'args>,
743 ) -> flatbuffers::WIPOffset<DelegateKey<'bldr>> {
744 let mut builder = DelegateKeyBuilder::new(_fbb);
745 if let Some(x) = args.code_hash {
746 builder.add_code_hash(x);
747 }
748 if let Some(x) = args.key {
749 builder.add_key(x);
750 }
751 builder.finish()
752 }
753
754 #[inline]
755 pub fn key(&self) -> flatbuffers::Vector<'a, u8> {
756 unsafe {
760 self._tab
761 .get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, u8>>>(
762 DelegateKey::VT_KEY,
763 None,
764 )
765 .unwrap()
766 }
767 }
768 #[inline]
769 pub fn code_hash(&self) -> flatbuffers::Vector<'a, u8> {
770 unsafe {
774 self._tab
775 .get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, u8>>>(
776 DelegateKey::VT_CODE_HASH,
777 None,
778 )
779 .unwrap()
780 }
781 }
782 }
783
784 impl flatbuffers::Verifiable for DelegateKey<'_> {
785 #[inline]
786 fn run_verifier(
787 v: &mut flatbuffers::Verifier,
788 pos: usize,
789 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
790 use self::flatbuffers::Verifiable;
791 v.visit_table(pos)?
792 .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, u8>>>(
793 "key",
794 Self::VT_KEY,
795 true,
796 )?
797 .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, u8>>>(
798 "code_hash",
799 Self::VT_CODE_HASH,
800 true,
801 )?
802 .finish();
803 Ok(())
804 }
805 }
806 pub struct DelegateKeyArgs<'a> {
807 pub key: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, u8>>>,
808 pub code_hash: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, u8>>>,
809 }
810 impl<'a> Default for DelegateKeyArgs<'a> {
811 #[inline]
812 fn default() -> Self {
813 DelegateKeyArgs {
814 key: None, code_hash: None, }
817 }
818 }
819
820 pub struct DelegateKeyBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
821 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
822 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
823 }
824 impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> DelegateKeyBuilder<'a, 'b, A> {
825 #[inline]
826 pub fn add_key(&mut self, key: flatbuffers::WIPOffset<flatbuffers::Vector<'b, u8>>) {
827 self.fbb_
828 .push_slot_always::<flatbuffers::WIPOffset<_>>(DelegateKey::VT_KEY, key);
829 }
830 #[inline]
831 pub fn add_code_hash(
832 &mut self,
833 code_hash: flatbuffers::WIPOffset<flatbuffers::Vector<'b, u8>>,
834 ) {
835 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(
836 DelegateKey::VT_CODE_HASH,
837 code_hash,
838 );
839 }
840 #[inline]
841 pub fn new(
842 _fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
843 ) -> DelegateKeyBuilder<'a, 'b, A> {
844 let start = _fbb.start_table();
845 DelegateKeyBuilder {
846 fbb_: _fbb,
847 start_: start,
848 }
849 }
850 #[inline]
851 pub fn finish(self) -> flatbuffers::WIPOffset<DelegateKey<'a>> {
852 let o = self.fbb_.end_table(self.start_);
853 self.fbb_.required(o, DelegateKey::VT_KEY, "key");
854 self.fbb_
855 .required(o, DelegateKey::VT_CODE_HASH, "code_hash");
856 flatbuffers::WIPOffset::new(o.value())
857 }
858 }
859
860 impl core::fmt::Debug for DelegateKey<'_> {
861 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
862 let mut ds = f.debug_struct("DelegateKey");
863 ds.field("key", &self.key());
864 ds.field("code_hash", &self.code_hash());
865 ds.finish()
866 }
867 }
868 pub enum DelegateContextOffset {}
869 #[derive(Copy, Clone, PartialEq)]
870
871 pub struct DelegateContext<'a> {
872 pub _tab: flatbuffers::Table<'a>,
873 }
874
875 impl<'a> flatbuffers::Follow<'a> for DelegateContext<'a> {
876 type Inner = DelegateContext<'a>;
877 #[inline]
878 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
879 Self {
880 _tab: flatbuffers::Table::new(buf, loc),
881 }
882 }
883 }
884
885 impl<'a> DelegateContext<'a> {
886 pub const VT_DATA: flatbuffers::VOffsetT = 4;
887
888 #[inline]
889 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
890 DelegateContext { _tab: table }
891 }
892 #[allow(unused_mut)]
893 pub fn create<
894 'bldr: 'args,
895 'args: 'mut_bldr,
896 'mut_bldr,
897 A: flatbuffers::Allocator + 'bldr,
898 >(
899 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
900 args: &'args DelegateContextArgs<'args>,
901 ) -> flatbuffers::WIPOffset<DelegateContext<'bldr>> {
902 let mut builder = DelegateContextBuilder::new(_fbb);
903 if let Some(x) = args.data {
904 builder.add_data(x);
905 }
906 builder.finish()
907 }
908
909 #[inline]
910 pub fn data(&self) -> flatbuffers::Vector<'a, u8> {
911 unsafe {
915 self._tab
916 .get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, u8>>>(
917 DelegateContext::VT_DATA,
918 None,
919 )
920 .unwrap()
921 }
922 }
923 }
924
925 impl flatbuffers::Verifiable for DelegateContext<'_> {
926 #[inline]
927 fn run_verifier(
928 v: &mut flatbuffers::Verifier,
929 pos: usize,
930 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
931 use self::flatbuffers::Verifiable;
932 v.visit_table(pos)?
933 .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, u8>>>(
934 "data",
935 Self::VT_DATA,
936 true,
937 )?
938 .finish();
939 Ok(())
940 }
941 }
942 pub struct DelegateContextArgs<'a> {
943 pub data: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, u8>>>,
944 }
945 impl<'a> Default for DelegateContextArgs<'a> {
946 #[inline]
947 fn default() -> Self {
948 DelegateContextArgs {
949 data: None, }
951 }
952 }
953
954 pub struct DelegateContextBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
955 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
956 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
957 }
958 impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> DelegateContextBuilder<'a, 'b, A> {
959 #[inline]
960 pub fn add_data(&mut self, data: flatbuffers::WIPOffset<flatbuffers::Vector<'b, u8>>) {
961 self.fbb_
962 .push_slot_always::<flatbuffers::WIPOffset<_>>(DelegateContext::VT_DATA, data);
963 }
964 #[inline]
965 pub fn new(
966 _fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
967 ) -> DelegateContextBuilder<'a, 'b, A> {
968 let start = _fbb.start_table();
969 DelegateContextBuilder {
970 fbb_: _fbb,
971 start_: start,
972 }
973 }
974 #[inline]
975 pub fn finish(self) -> flatbuffers::WIPOffset<DelegateContext<'a>> {
976 let o = self.fbb_.end_table(self.start_);
977 self.fbb_.required(o, DelegateContext::VT_DATA, "data");
978 flatbuffers::WIPOffset::new(o.value())
979 }
980 }
981
982 impl core::fmt::Debug for DelegateContext<'_> {
983 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
984 let mut ds = f.debug_struct("DelegateContext");
985 ds.field("data", &self.data());
986 ds.finish()
987 }
988 }
989 pub enum WasmDelegateV1Offset {}
990 #[derive(Copy, Clone, PartialEq)]
991
992 pub struct WasmDelegateV1<'a> {
993 pub _tab: flatbuffers::Table<'a>,
994 }
995
996 impl<'a> flatbuffers::Follow<'a> for WasmDelegateV1<'a> {
997 type Inner = WasmDelegateV1<'a>;
998 #[inline]
999 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
1000 Self {
1001 _tab: flatbuffers::Table::new(buf, loc),
1002 }
1003 }
1004 }
1005
1006 impl<'a> WasmDelegateV1<'a> {
1007 pub const VT_PARAMETERS: flatbuffers::VOffsetT = 4;
1008 pub const VT_DATA: flatbuffers::VOffsetT = 6;
1009 pub const VT_KEY: flatbuffers::VOffsetT = 8;
1010
1011 #[inline]
1012 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
1013 WasmDelegateV1 { _tab: table }
1014 }
1015 #[allow(unused_mut)]
1016 pub fn create<
1017 'bldr: 'args,
1018 'args: 'mut_bldr,
1019 'mut_bldr,
1020 A: flatbuffers::Allocator + 'bldr,
1021 >(
1022 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
1023 args: &'args WasmDelegateV1Args<'args>,
1024 ) -> flatbuffers::WIPOffset<WasmDelegateV1<'bldr>> {
1025 let mut builder = WasmDelegateV1Builder::new(_fbb);
1026 if let Some(x) = args.key {
1027 builder.add_key(x);
1028 }
1029 if let Some(x) = args.data {
1030 builder.add_data(x);
1031 }
1032 if let Some(x) = args.parameters {
1033 builder.add_parameters(x);
1034 }
1035 builder.finish()
1036 }
1037
1038 #[inline]
1039 pub fn parameters(&self) -> flatbuffers::Vector<'a, u8> {
1040 unsafe {
1044 self._tab
1045 .get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, u8>>>(
1046 WasmDelegateV1::VT_PARAMETERS,
1047 None,
1048 )
1049 .unwrap()
1050 }
1051 }
1052 #[inline]
1053 pub fn data(&self) -> DelegateCode<'a> {
1054 unsafe {
1058 self._tab
1059 .get::<flatbuffers::ForwardsUOffset<DelegateCode>>(
1060 WasmDelegateV1::VT_DATA,
1061 None,
1062 )
1063 .unwrap()
1064 }
1065 }
1066 #[inline]
1067 pub fn key(&self) -> DelegateKey<'a> {
1068 unsafe {
1072 self._tab
1073 .get::<flatbuffers::ForwardsUOffset<DelegateKey>>(WasmDelegateV1::VT_KEY, None)
1074 .unwrap()
1075 }
1076 }
1077 }
1078
1079 impl flatbuffers::Verifiable for WasmDelegateV1<'_> {
1080 #[inline]
1081 fn run_verifier(
1082 v: &mut flatbuffers::Verifier,
1083 pos: usize,
1084 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
1085 use self::flatbuffers::Verifiable;
1086 v.visit_table(pos)?
1087 .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, u8>>>(
1088 "parameters",
1089 Self::VT_PARAMETERS,
1090 true,
1091 )?
1092 .visit_field::<flatbuffers::ForwardsUOffset<DelegateCode>>(
1093 "data",
1094 Self::VT_DATA,
1095 true,
1096 )?
1097 .visit_field::<flatbuffers::ForwardsUOffset<DelegateKey>>(
1098 "key",
1099 Self::VT_KEY,
1100 true,
1101 )?
1102 .finish();
1103 Ok(())
1104 }
1105 }
1106 pub struct WasmDelegateV1Args<'a> {
1107 pub parameters: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, u8>>>,
1108 pub data: Option<flatbuffers::WIPOffset<DelegateCode<'a>>>,
1109 pub key: Option<flatbuffers::WIPOffset<DelegateKey<'a>>>,
1110 }
1111 impl<'a> Default for WasmDelegateV1Args<'a> {
1112 #[inline]
1113 fn default() -> Self {
1114 WasmDelegateV1Args {
1115 parameters: None, data: None, key: None, }
1119 }
1120 }
1121
1122 pub struct WasmDelegateV1Builder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
1123 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
1124 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
1125 }
1126 impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> WasmDelegateV1Builder<'a, 'b, A> {
1127 #[inline]
1128 pub fn add_parameters(
1129 &mut self,
1130 parameters: flatbuffers::WIPOffset<flatbuffers::Vector<'b, u8>>,
1131 ) {
1132 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(
1133 WasmDelegateV1::VT_PARAMETERS,
1134 parameters,
1135 );
1136 }
1137 #[inline]
1138 pub fn add_data(&mut self, data: flatbuffers::WIPOffset<DelegateCode<'b>>) {
1139 self.fbb_
1140 .push_slot_always::<flatbuffers::WIPOffset<DelegateCode>>(
1141 WasmDelegateV1::VT_DATA,
1142 data,
1143 );
1144 }
1145 #[inline]
1146 pub fn add_key(&mut self, key: flatbuffers::WIPOffset<DelegateKey<'b>>) {
1147 self.fbb_
1148 .push_slot_always::<flatbuffers::WIPOffset<DelegateKey>>(
1149 WasmDelegateV1::VT_KEY,
1150 key,
1151 );
1152 }
1153 #[inline]
1154 pub fn new(
1155 _fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
1156 ) -> WasmDelegateV1Builder<'a, 'b, A> {
1157 let start = _fbb.start_table();
1158 WasmDelegateV1Builder {
1159 fbb_: _fbb,
1160 start_: start,
1161 }
1162 }
1163 #[inline]
1164 pub fn finish(self) -> flatbuffers::WIPOffset<WasmDelegateV1<'a>> {
1165 let o = self.fbb_.end_table(self.start_);
1166 self.fbb_
1167 .required(o, WasmDelegateV1::VT_PARAMETERS, "parameters");
1168 self.fbb_.required(o, WasmDelegateV1::VT_DATA, "data");
1169 self.fbb_.required(o, WasmDelegateV1::VT_KEY, "key");
1170 flatbuffers::WIPOffset::new(o.value())
1171 }
1172 }
1173
1174 impl core::fmt::Debug for WasmDelegateV1<'_> {
1175 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
1176 let mut ds = f.debug_struct("WasmDelegateV1");
1177 ds.field("parameters", &self.parameters());
1178 ds.field("data", &self.data());
1179 ds.field("key", &self.key());
1180 ds.finish()
1181 }
1182 }
1183 pub enum DelegateContainerOffset {}
1184 #[derive(Copy, Clone, PartialEq)]
1185
1186 pub struct DelegateContainer<'a> {
1187 pub _tab: flatbuffers::Table<'a>,
1188 }
1189
1190 impl<'a> flatbuffers::Follow<'a> for DelegateContainer<'a> {
1191 type Inner = DelegateContainer<'a>;
1192 #[inline]
1193 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
1194 Self {
1195 _tab: flatbuffers::Table::new(buf, loc),
1196 }
1197 }
1198 }
1199
1200 impl<'a> DelegateContainer<'a> {
1201 pub const VT_DELEGATE_TYPE: flatbuffers::VOffsetT = 4;
1202 pub const VT_DELEGATE: flatbuffers::VOffsetT = 6;
1203
1204 #[inline]
1205 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
1206 DelegateContainer { _tab: table }
1207 }
1208 #[allow(unused_mut)]
1209 pub fn create<
1210 'bldr: 'args,
1211 'args: 'mut_bldr,
1212 'mut_bldr,
1213 A: flatbuffers::Allocator + 'bldr,
1214 >(
1215 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
1216 args: &'args DelegateContainerArgs,
1217 ) -> flatbuffers::WIPOffset<DelegateContainer<'bldr>> {
1218 let mut builder = DelegateContainerBuilder::new(_fbb);
1219 if let Some(x) = args.delegate {
1220 builder.add_delegate(x);
1221 }
1222 builder.add_delegate_type(args.delegate_type);
1223 builder.finish()
1224 }
1225
1226 #[inline]
1227 pub fn delegate_type(&self) -> DelegateType {
1228 unsafe {
1232 self._tab
1233 .get::<DelegateType>(
1234 DelegateContainer::VT_DELEGATE_TYPE,
1235 Some(DelegateType::NONE),
1236 )
1237 .unwrap()
1238 }
1239 }
1240 #[inline]
1241 pub fn delegate(&self) -> flatbuffers::Table<'a> {
1242 unsafe {
1246 self._tab
1247 .get::<flatbuffers::ForwardsUOffset<flatbuffers::Table<'a>>>(
1248 DelegateContainer::VT_DELEGATE,
1249 None,
1250 )
1251 .unwrap()
1252 }
1253 }
1254 #[inline]
1255 #[allow(non_snake_case)]
1256 pub fn delegate_as_wasm_delegate_v1(&self) -> Option<WasmDelegateV1<'a>> {
1257 if self.delegate_type() == DelegateType::WasmDelegateV1 {
1258 let u = self.delegate();
1259 Some(unsafe { WasmDelegateV1::init_from_table(u) })
1263 } else {
1264 None
1265 }
1266 }
1267 }
1268
1269 impl flatbuffers::Verifiable for DelegateContainer<'_> {
1270 #[inline]
1271 fn run_verifier(
1272 v: &mut flatbuffers::Verifier,
1273 pos: usize,
1274 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
1275 use self::flatbuffers::Verifiable;
1276 v.visit_table(pos)?
1277 .visit_union::<DelegateType, _>(
1278 "delegate_type",
1279 Self::VT_DELEGATE_TYPE,
1280 "delegate",
1281 Self::VT_DELEGATE,
1282 true,
1283 |key, v, pos| match key {
1284 DelegateType::WasmDelegateV1 => v
1285 .verify_union_variant::<flatbuffers::ForwardsUOffset<WasmDelegateV1>>(
1286 "DelegateType::WasmDelegateV1",
1287 pos,
1288 ),
1289 _ => Ok(()),
1290 },
1291 )?
1292 .finish();
1293 Ok(())
1294 }
1295 }
1296 pub struct DelegateContainerArgs {
1297 pub delegate_type: DelegateType,
1298 pub delegate: Option<flatbuffers::WIPOffset<flatbuffers::UnionWIPOffset>>,
1299 }
1300 impl<'a> Default for DelegateContainerArgs {
1301 #[inline]
1302 fn default() -> Self {
1303 DelegateContainerArgs {
1304 delegate_type: DelegateType::NONE,
1305 delegate: None, }
1307 }
1308 }
1309
1310 pub struct DelegateContainerBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
1311 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
1312 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
1313 }
1314 impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> DelegateContainerBuilder<'a, 'b, A> {
1315 #[inline]
1316 pub fn add_delegate_type(&mut self, delegate_type: DelegateType) {
1317 self.fbb_.push_slot::<DelegateType>(
1318 DelegateContainer::VT_DELEGATE_TYPE,
1319 delegate_type,
1320 DelegateType::NONE,
1321 );
1322 }
1323 #[inline]
1324 pub fn add_delegate(
1325 &mut self,
1326 delegate: flatbuffers::WIPOffset<flatbuffers::UnionWIPOffset>,
1327 ) {
1328 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(
1329 DelegateContainer::VT_DELEGATE,
1330 delegate,
1331 );
1332 }
1333 #[inline]
1334 pub fn new(
1335 _fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
1336 ) -> DelegateContainerBuilder<'a, 'b, A> {
1337 let start = _fbb.start_table();
1338 DelegateContainerBuilder {
1339 fbb_: _fbb,
1340 start_: start,
1341 }
1342 }
1343 #[inline]
1344 pub fn finish(self) -> flatbuffers::WIPOffset<DelegateContainer<'a>> {
1345 let o = self.fbb_.end_table(self.start_);
1346 self.fbb_
1347 .required(o, DelegateContainer::VT_DELEGATE, "delegate");
1348 flatbuffers::WIPOffset::new(o.value())
1349 }
1350 }
1351
1352 impl core::fmt::Debug for DelegateContainer<'_> {
1353 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
1354 let mut ds = f.debug_struct("DelegateContainer");
1355 ds.field("delegate_type", &self.delegate_type());
1356 match self.delegate_type() {
1357 DelegateType::WasmDelegateV1 => {
1358 if let Some(x) = self.delegate_as_wasm_delegate_v1() {
1359 ds.field("delegate", &x)
1360 } else {
1361 ds.field(
1362 "delegate",
1363 &"InvalidFlatbuffer: Union discriminant does not match value.",
1364 )
1365 }
1366 }
1367 _ => {
1368 let x: Option<()> = None;
1369 ds.field("delegate", &x)
1370 }
1371 };
1372 ds.finish()
1373 }
1374 }
1375 pub enum RelatedContractOffset {}
1376 #[derive(Copy, Clone, PartialEq)]
1377
1378 pub struct RelatedContract<'a> {
1379 pub _tab: flatbuffers::Table<'a>,
1380 }
1381
1382 impl<'a> flatbuffers::Follow<'a> for RelatedContract<'a> {
1383 type Inner = RelatedContract<'a>;
1384 #[inline]
1385 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
1386 Self {
1387 _tab: flatbuffers::Table::new(buf, loc),
1388 }
1389 }
1390 }
1391
1392 impl<'a> RelatedContract<'a> {
1393 pub const VT_INSTANCE_ID: flatbuffers::VOffsetT = 4;
1394 pub const VT_STATE: flatbuffers::VOffsetT = 6;
1395
1396 #[inline]
1397 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
1398 RelatedContract { _tab: table }
1399 }
1400 #[allow(unused_mut)]
1401 pub fn create<
1402 'bldr: 'args,
1403 'args: 'mut_bldr,
1404 'mut_bldr,
1405 A: flatbuffers::Allocator + 'bldr,
1406 >(
1407 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
1408 args: &'args RelatedContractArgs<'args>,
1409 ) -> flatbuffers::WIPOffset<RelatedContract<'bldr>> {
1410 let mut builder = RelatedContractBuilder::new(_fbb);
1411 if let Some(x) = args.state {
1412 builder.add_state(x);
1413 }
1414 if let Some(x) = args.instance_id {
1415 builder.add_instance_id(x);
1416 }
1417 builder.finish()
1418 }
1419
1420 #[inline]
1421 pub fn instance_id(&self) -> super::common::ContractInstanceId<'a> {
1422 unsafe {
1426 self._tab
1427 .get::<flatbuffers::ForwardsUOffset<super::common::ContractInstanceId>>(
1428 RelatedContract::VT_INSTANCE_ID,
1429 None,
1430 )
1431 .unwrap()
1432 }
1433 }
1434 #[inline]
1435 pub fn state(&self) -> flatbuffers::Vector<'a, u8> {
1436 unsafe {
1440 self._tab
1441 .get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, u8>>>(
1442 RelatedContract::VT_STATE,
1443 None,
1444 )
1445 .unwrap()
1446 }
1447 }
1448 }
1449
1450 impl flatbuffers::Verifiable for RelatedContract<'_> {
1451 #[inline]
1452 fn run_verifier(
1453 v: &mut flatbuffers::Verifier,
1454 pos: usize,
1455 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
1456 use self::flatbuffers::Verifiable;
1457 v.visit_table(pos)?
1458 .visit_field::<flatbuffers::ForwardsUOffset<super::common::ContractInstanceId>>(
1459 "instance_id",
1460 Self::VT_INSTANCE_ID,
1461 true,
1462 )?
1463 .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, u8>>>(
1464 "state",
1465 Self::VT_STATE,
1466 true,
1467 )?
1468 .finish();
1469 Ok(())
1470 }
1471 }
1472 pub struct RelatedContractArgs<'a> {
1473 pub instance_id: Option<flatbuffers::WIPOffset<super::common::ContractInstanceId<'a>>>,
1474 pub state: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, u8>>>,
1475 }
1476 impl<'a> Default for RelatedContractArgs<'a> {
1477 #[inline]
1478 fn default() -> Self {
1479 RelatedContractArgs {
1480 instance_id: None, state: None, }
1483 }
1484 }
1485
1486 pub struct RelatedContractBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
1487 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
1488 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
1489 }
1490 impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> RelatedContractBuilder<'a, 'b, A> {
1491 #[inline]
1492 pub fn add_instance_id(
1493 &mut self,
1494 instance_id: flatbuffers::WIPOffset<super::common::ContractInstanceId<'b>>,
1495 ) {
1496 self.fbb_
1497 .push_slot_always::<flatbuffers::WIPOffset<super::common::ContractInstanceId>>(
1498 RelatedContract::VT_INSTANCE_ID,
1499 instance_id,
1500 );
1501 }
1502 #[inline]
1503 pub fn add_state(&mut self, state: flatbuffers::WIPOffset<flatbuffers::Vector<'b, u8>>) {
1504 self.fbb_
1505 .push_slot_always::<flatbuffers::WIPOffset<_>>(RelatedContract::VT_STATE, state);
1506 }
1507 #[inline]
1508 pub fn new(
1509 _fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
1510 ) -> RelatedContractBuilder<'a, 'b, A> {
1511 let start = _fbb.start_table();
1512 RelatedContractBuilder {
1513 fbb_: _fbb,
1514 start_: start,
1515 }
1516 }
1517 #[inline]
1518 pub fn finish(self) -> flatbuffers::WIPOffset<RelatedContract<'a>> {
1519 let o = self.fbb_.end_table(self.start_);
1520 self.fbb_
1521 .required(o, RelatedContract::VT_INSTANCE_ID, "instance_id");
1522 self.fbb_.required(o, RelatedContract::VT_STATE, "state");
1523 flatbuffers::WIPOffset::new(o.value())
1524 }
1525 }
1526
1527 impl core::fmt::Debug for RelatedContract<'_> {
1528 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
1529 let mut ds = f.debug_struct("RelatedContract");
1530 ds.field("instance_id", &self.instance_id());
1531 ds.field("state", &self.state());
1532 ds.finish()
1533 }
1534 }
1535 pub enum RelatedContractsOffset {}
1536 #[derive(Copy, Clone, PartialEq)]
1537
1538 pub struct RelatedContracts<'a> {
1539 pub _tab: flatbuffers::Table<'a>,
1540 }
1541
1542 impl<'a> flatbuffers::Follow<'a> for RelatedContracts<'a> {
1543 type Inner = RelatedContracts<'a>;
1544 #[inline]
1545 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
1546 Self {
1547 _tab: flatbuffers::Table::new(buf, loc),
1548 }
1549 }
1550 }
1551
1552 impl<'a> RelatedContracts<'a> {
1553 pub const VT_CONTRACTS: flatbuffers::VOffsetT = 4;
1554
1555 #[inline]
1556 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
1557 RelatedContracts { _tab: table }
1558 }
1559 #[allow(unused_mut)]
1560 pub fn create<
1561 'bldr: 'args,
1562 'args: 'mut_bldr,
1563 'mut_bldr,
1564 A: flatbuffers::Allocator + 'bldr,
1565 >(
1566 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
1567 args: &'args RelatedContractsArgs<'args>,
1568 ) -> flatbuffers::WIPOffset<RelatedContracts<'bldr>> {
1569 let mut builder = RelatedContractsBuilder::new(_fbb);
1570 if let Some(x) = args.contracts {
1571 builder.add_contracts(x);
1572 }
1573 builder.finish()
1574 }
1575
1576 #[inline]
1577 pub fn contracts(
1578 &self,
1579 ) -> flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<RelatedContract<'a>>> {
1580 unsafe {
1584 self._tab
1585 .get::<flatbuffers::ForwardsUOffset<
1586 flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<RelatedContract>>,
1587 >>(RelatedContracts::VT_CONTRACTS, None)
1588 .unwrap()
1589 }
1590 }
1591 }
1592
1593 impl flatbuffers::Verifiable for RelatedContracts<'_> {
1594 #[inline]
1595 fn run_verifier(
1596 v: &mut flatbuffers::Verifier,
1597 pos: usize,
1598 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
1599 use self::flatbuffers::Verifiable;
1600 v.visit_table(pos)?
1601 .visit_field::<flatbuffers::ForwardsUOffset<
1602 flatbuffers::Vector<'_, flatbuffers::ForwardsUOffset<RelatedContract>>,
1603 >>("contracts", Self::VT_CONTRACTS, true)?
1604 .finish();
1605 Ok(())
1606 }
1607 }
1608 pub struct RelatedContractsArgs<'a> {
1609 pub contracts: Option<
1610 flatbuffers::WIPOffset<
1611 flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<RelatedContract<'a>>>,
1612 >,
1613 >,
1614 }
1615 impl<'a> Default for RelatedContractsArgs<'a> {
1616 #[inline]
1617 fn default() -> Self {
1618 RelatedContractsArgs {
1619 contracts: None, }
1621 }
1622 }
1623
1624 pub struct RelatedContractsBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
1625 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
1626 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
1627 }
1628 impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> RelatedContractsBuilder<'a, 'b, A> {
1629 #[inline]
1630 pub fn add_contracts(
1631 &mut self,
1632 contracts: flatbuffers::WIPOffset<
1633 flatbuffers::Vector<'b, flatbuffers::ForwardsUOffset<RelatedContract<'b>>>,
1634 >,
1635 ) {
1636 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(
1637 RelatedContracts::VT_CONTRACTS,
1638 contracts,
1639 );
1640 }
1641 #[inline]
1642 pub fn new(
1643 _fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
1644 ) -> RelatedContractsBuilder<'a, 'b, A> {
1645 let start = _fbb.start_table();
1646 RelatedContractsBuilder {
1647 fbb_: _fbb,
1648 start_: start,
1649 }
1650 }
1651 #[inline]
1652 pub fn finish(self) -> flatbuffers::WIPOffset<RelatedContracts<'a>> {
1653 let o = self.fbb_.end_table(self.start_);
1654 self.fbb_
1655 .required(o, RelatedContracts::VT_CONTRACTS, "contracts");
1656 flatbuffers::WIPOffset::new(o.value())
1657 }
1658 }
1659
1660 impl core::fmt::Debug for RelatedContracts<'_> {
1661 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
1662 let mut ds = f.debug_struct("RelatedContracts");
1663 ds.field("contracts", &self.contracts());
1664 ds.finish()
1665 }
1666 }
1667 pub enum PutOffset {}
1668 #[derive(Copy, Clone, PartialEq)]
1669
1670 pub struct Put<'a> {
1671 pub _tab: flatbuffers::Table<'a>,
1672 }
1673
1674 impl<'a> flatbuffers::Follow<'a> for Put<'a> {
1675 type Inner = Put<'a>;
1676 #[inline]
1677 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
1678 Self {
1679 _tab: flatbuffers::Table::new(buf, loc),
1680 }
1681 }
1682 }
1683
1684 impl<'a> Put<'a> {
1685 pub const VT_CONTAINER: flatbuffers::VOffsetT = 4;
1686 pub const VT_WRAPPED_STATE: flatbuffers::VOffsetT = 6;
1687 pub const VT_RELATED_CONTRACTS: flatbuffers::VOffsetT = 8;
1688 pub const VT_SUBSCRIBE: flatbuffers::VOffsetT = 10;
1689
1690 #[inline]
1691 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
1692 Put { _tab: table }
1693 }
1694 #[allow(unused_mut)]
1695 pub fn create<
1696 'bldr: 'args,
1697 'args: 'mut_bldr,
1698 'mut_bldr,
1699 A: flatbuffers::Allocator + 'bldr,
1700 >(
1701 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
1702 args: &'args PutArgs<'args>,
1703 ) -> flatbuffers::WIPOffset<Put<'bldr>> {
1704 let mut builder = PutBuilder::new(_fbb);
1705 if let Some(x) = args.related_contracts {
1706 builder.add_related_contracts(x);
1707 }
1708 if let Some(x) = args.wrapped_state {
1709 builder.add_wrapped_state(x);
1710 }
1711 if let Some(x) = args.container {
1712 builder.add_container(x);
1713 }
1714 builder.add_subscribe(args.subscribe);
1715 builder.finish()
1716 }
1717
1718 #[inline]
1719 pub fn container(&self) -> super::common::ContractContainer<'a> {
1720 unsafe {
1724 self._tab
1725 .get::<flatbuffers::ForwardsUOffset<super::common::ContractContainer>>(
1726 Put::VT_CONTAINER,
1727 None,
1728 )
1729 .unwrap()
1730 }
1731 }
1732 #[inline]
1733 pub fn wrapped_state(&self) -> flatbuffers::Vector<'a, u8> {
1734 unsafe {
1738 self._tab
1739 .get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, u8>>>(
1740 Put::VT_WRAPPED_STATE,
1741 None,
1742 )
1743 .unwrap()
1744 }
1745 }
1746 #[inline]
1747 pub fn related_contracts(&self) -> RelatedContracts<'a> {
1748 unsafe {
1752 self._tab
1753 .get::<flatbuffers::ForwardsUOffset<RelatedContracts>>(
1754 Put::VT_RELATED_CONTRACTS,
1755 None,
1756 )
1757 .unwrap()
1758 }
1759 }
1760 #[inline]
1761 pub fn subscribe(&self) -> bool {
1762 unsafe {
1766 self._tab
1767 .get::<bool>(Put::VT_SUBSCRIBE, Some(false))
1768 .unwrap()
1769 }
1770 }
1771 }
1772
1773 impl flatbuffers::Verifiable for Put<'_> {
1774 #[inline]
1775 fn run_verifier(
1776 v: &mut flatbuffers::Verifier,
1777 pos: usize,
1778 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
1779 use self::flatbuffers::Verifiable;
1780 v.visit_table(pos)?
1781 .visit_field::<flatbuffers::ForwardsUOffset<super::common::ContractContainer>>(
1782 "container",
1783 Self::VT_CONTAINER,
1784 true,
1785 )?
1786 .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, u8>>>(
1787 "wrapped_state",
1788 Self::VT_WRAPPED_STATE,
1789 true,
1790 )?
1791 .visit_field::<flatbuffers::ForwardsUOffset<RelatedContracts>>(
1792 "related_contracts",
1793 Self::VT_RELATED_CONTRACTS,
1794 true,
1795 )?
1796 .visit_field::<bool>("subscribe", Self::VT_SUBSCRIBE, false)?
1797 .finish();
1798 Ok(())
1799 }
1800 }
1801 pub struct PutArgs<'a> {
1802 pub container: Option<flatbuffers::WIPOffset<super::common::ContractContainer<'a>>>,
1803 pub wrapped_state: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, u8>>>,
1804 pub related_contracts: Option<flatbuffers::WIPOffset<RelatedContracts<'a>>>,
1805 pub subscribe: bool,
1806 }
1807 impl<'a> Default for PutArgs<'a> {
1808 #[inline]
1809 fn default() -> Self {
1810 PutArgs {
1811 container: None, wrapped_state: None, related_contracts: None, subscribe: false,
1815 }
1816 }
1817 }
1818
1819 pub struct PutBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
1820 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
1821 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
1822 }
1823 impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> PutBuilder<'a, 'b, A> {
1824 #[inline]
1825 pub fn add_container(
1826 &mut self,
1827 container: flatbuffers::WIPOffset<super::common::ContractContainer<'b>>,
1828 ) {
1829 self.fbb_
1830 .push_slot_always::<flatbuffers::WIPOffset<super::common::ContractContainer>>(
1831 Put::VT_CONTAINER,
1832 container,
1833 );
1834 }
1835 #[inline]
1836 pub fn add_wrapped_state(
1837 &mut self,
1838 wrapped_state: flatbuffers::WIPOffset<flatbuffers::Vector<'b, u8>>,
1839 ) {
1840 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(
1841 Put::VT_WRAPPED_STATE,
1842 wrapped_state,
1843 );
1844 }
1845 #[inline]
1846 pub fn add_related_contracts(
1847 &mut self,
1848 related_contracts: flatbuffers::WIPOffset<RelatedContracts<'b>>,
1849 ) {
1850 self.fbb_
1851 .push_slot_always::<flatbuffers::WIPOffset<RelatedContracts>>(
1852 Put::VT_RELATED_CONTRACTS,
1853 related_contracts,
1854 );
1855 }
1856 #[inline]
1857 pub fn add_subscribe(&mut self, subscribe: bool) {
1858 self.fbb_
1859 .push_slot::<bool>(Put::VT_SUBSCRIBE, subscribe, false);
1860 }
1861 #[inline]
1862 pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> PutBuilder<'a, 'b, A> {
1863 let start = _fbb.start_table();
1864 PutBuilder {
1865 fbb_: _fbb,
1866 start_: start,
1867 }
1868 }
1869 #[inline]
1870 pub fn finish(self) -> flatbuffers::WIPOffset<Put<'a>> {
1871 let o = self.fbb_.end_table(self.start_);
1872 self.fbb_.required(o, Put::VT_CONTAINER, "container");
1873 self.fbb_
1874 .required(o, Put::VT_WRAPPED_STATE, "wrapped_state");
1875 self.fbb_
1876 .required(o, Put::VT_RELATED_CONTRACTS, "related_contracts");
1877 flatbuffers::WIPOffset::new(o.value())
1878 }
1879 }
1880
1881 impl core::fmt::Debug for Put<'_> {
1882 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
1883 let mut ds = f.debug_struct("Put");
1884 ds.field("container", &self.container());
1885 ds.field("wrapped_state", &self.wrapped_state());
1886 ds.field("related_contracts", &self.related_contracts());
1887 ds.field("subscribe", &self.subscribe());
1888 ds.finish()
1889 }
1890 }
1891 pub enum UpdateOffset {}
1892 #[derive(Copy, Clone, PartialEq)]
1893
1894 pub struct Update<'a> {
1895 pub _tab: flatbuffers::Table<'a>,
1896 }
1897
1898 impl<'a> flatbuffers::Follow<'a> for Update<'a> {
1899 type Inner = Update<'a>;
1900 #[inline]
1901 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
1902 Self {
1903 _tab: flatbuffers::Table::new(buf, loc),
1904 }
1905 }
1906 }
1907
1908 impl<'a> Update<'a> {
1909 pub const VT_KEY: flatbuffers::VOffsetT = 4;
1910 pub const VT_DATA: flatbuffers::VOffsetT = 6;
1911
1912 #[inline]
1913 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
1914 Update { _tab: table }
1915 }
1916 #[allow(unused_mut)]
1917 pub fn create<
1918 'bldr: 'args,
1919 'args: 'mut_bldr,
1920 'mut_bldr,
1921 A: flatbuffers::Allocator + 'bldr,
1922 >(
1923 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
1924 args: &'args UpdateArgs<'args>,
1925 ) -> flatbuffers::WIPOffset<Update<'bldr>> {
1926 let mut builder = UpdateBuilder::new(_fbb);
1927 if let Some(x) = args.data {
1928 builder.add_data(x);
1929 }
1930 if let Some(x) = args.key {
1931 builder.add_key(x);
1932 }
1933 builder.finish()
1934 }
1935
1936 #[inline]
1937 pub fn key(&self) -> super::common::ContractKey<'a> {
1938 unsafe {
1942 self._tab
1943 .get::<flatbuffers::ForwardsUOffset<super::common::ContractKey>>(
1944 Update::VT_KEY,
1945 None,
1946 )
1947 .unwrap()
1948 }
1949 }
1950 #[inline]
1951 pub fn data(&self) -> super::common::UpdateData<'a> {
1952 unsafe {
1956 self._tab
1957 .get::<flatbuffers::ForwardsUOffset<super::common::UpdateData>>(
1958 Update::VT_DATA,
1959 None,
1960 )
1961 .unwrap()
1962 }
1963 }
1964 }
1965
1966 impl flatbuffers::Verifiable for Update<'_> {
1967 #[inline]
1968 fn run_verifier(
1969 v: &mut flatbuffers::Verifier,
1970 pos: usize,
1971 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
1972 use self::flatbuffers::Verifiable;
1973 v.visit_table(pos)?
1974 .visit_field::<flatbuffers::ForwardsUOffset<super::common::ContractKey>>(
1975 "key",
1976 Self::VT_KEY,
1977 true,
1978 )?
1979 .visit_field::<flatbuffers::ForwardsUOffset<super::common::UpdateData>>(
1980 "data",
1981 Self::VT_DATA,
1982 true,
1983 )?
1984 .finish();
1985 Ok(())
1986 }
1987 }
1988 pub struct UpdateArgs<'a> {
1989 pub key: Option<flatbuffers::WIPOffset<super::common::ContractKey<'a>>>,
1990 pub data: Option<flatbuffers::WIPOffset<super::common::UpdateData<'a>>>,
1991 }
1992 impl<'a> Default for UpdateArgs<'a> {
1993 #[inline]
1994 fn default() -> Self {
1995 UpdateArgs {
1996 key: None, data: None, }
1999 }
2000 }
2001
2002 pub struct UpdateBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
2003 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
2004 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
2005 }
2006 impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> UpdateBuilder<'a, 'b, A> {
2007 #[inline]
2008 pub fn add_key(&mut self, key: flatbuffers::WIPOffset<super::common::ContractKey<'b>>) {
2009 self.fbb_
2010 .push_slot_always::<flatbuffers::WIPOffset<super::common::ContractKey>>(
2011 Update::VT_KEY,
2012 key,
2013 );
2014 }
2015 #[inline]
2016 pub fn add_data(&mut self, data: flatbuffers::WIPOffset<super::common::UpdateData<'b>>) {
2017 self.fbb_
2018 .push_slot_always::<flatbuffers::WIPOffset<super::common::UpdateData>>(
2019 Update::VT_DATA,
2020 data,
2021 );
2022 }
2023 #[inline]
2024 pub fn new(
2025 _fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
2026 ) -> UpdateBuilder<'a, 'b, A> {
2027 let start = _fbb.start_table();
2028 UpdateBuilder {
2029 fbb_: _fbb,
2030 start_: start,
2031 }
2032 }
2033 #[inline]
2034 pub fn finish(self) -> flatbuffers::WIPOffset<Update<'a>> {
2035 let o = self.fbb_.end_table(self.start_);
2036 self.fbb_.required(o, Update::VT_KEY, "key");
2037 self.fbb_.required(o, Update::VT_DATA, "data");
2038 flatbuffers::WIPOffset::new(o.value())
2039 }
2040 }
2041
2042 impl core::fmt::Debug for Update<'_> {
2043 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
2044 let mut ds = f.debug_struct("Update");
2045 ds.field("key", &self.key());
2046 ds.field("data", &self.data());
2047 ds.finish()
2048 }
2049 }
2050 pub enum GetOffset {}
2051 #[derive(Copy, Clone, PartialEq)]
2052
2053 pub struct Get<'a> {
2054 pub _tab: flatbuffers::Table<'a>,
2055 }
2056
2057 impl<'a> flatbuffers::Follow<'a> for Get<'a> {
2058 type Inner = Get<'a>;
2059 #[inline]
2060 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
2061 Self {
2062 _tab: flatbuffers::Table::new(buf, loc),
2063 }
2064 }
2065 }
2066
2067 impl<'a> Get<'a> {
2068 pub const VT_KEY: flatbuffers::VOffsetT = 4;
2069 pub const VT_FETCH_CONTRACT: flatbuffers::VOffsetT = 6;
2070 pub const VT_SUBSCRIBE: flatbuffers::VOffsetT = 8;
2071
2072 #[inline]
2073 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
2074 Get { _tab: table }
2075 }
2076 #[allow(unused_mut)]
2077 pub fn create<
2078 'bldr: 'args,
2079 'args: 'mut_bldr,
2080 'mut_bldr,
2081 A: flatbuffers::Allocator + 'bldr,
2082 >(
2083 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
2084 args: &'args GetArgs<'args>,
2085 ) -> flatbuffers::WIPOffset<Get<'bldr>> {
2086 let mut builder = GetBuilder::new(_fbb);
2087 if let Some(x) = args.key {
2088 builder.add_key(x);
2089 }
2090 builder.add_subscribe(args.subscribe);
2091 builder.add_fetch_contract(args.fetch_contract);
2092 builder.finish()
2093 }
2094
2095 #[inline]
2096 pub fn key(&self) -> super::common::ContractKey<'a> {
2097 unsafe {
2101 self._tab
2102 .get::<flatbuffers::ForwardsUOffset<super::common::ContractKey>>(
2103 Get::VT_KEY,
2104 None,
2105 )
2106 .unwrap()
2107 }
2108 }
2109 #[inline]
2110 pub fn fetch_contract(&self) -> bool {
2111 unsafe {
2115 self._tab
2116 .get::<bool>(Get::VT_FETCH_CONTRACT, Some(false))
2117 .unwrap()
2118 }
2119 }
2120 #[inline]
2121 pub fn subscribe(&self) -> bool {
2122 unsafe {
2126 self._tab
2127 .get::<bool>(Get::VT_SUBSCRIBE, Some(false))
2128 .unwrap()
2129 }
2130 }
2131 }
2132
2133 impl flatbuffers::Verifiable for Get<'_> {
2134 #[inline]
2135 fn run_verifier(
2136 v: &mut flatbuffers::Verifier,
2137 pos: usize,
2138 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
2139 use self::flatbuffers::Verifiable;
2140 v.visit_table(pos)?
2141 .visit_field::<flatbuffers::ForwardsUOffset<super::common::ContractKey>>(
2142 "key",
2143 Self::VT_KEY,
2144 true,
2145 )?
2146 .visit_field::<bool>("fetch_contract", Self::VT_FETCH_CONTRACT, false)?
2147 .visit_field::<bool>("subscribe", Self::VT_SUBSCRIBE, false)?
2148 .finish();
2149 Ok(())
2150 }
2151 }
2152 pub struct GetArgs<'a> {
2153 pub key: Option<flatbuffers::WIPOffset<super::common::ContractKey<'a>>>,
2154 pub fetch_contract: bool,
2155 pub subscribe: bool,
2156 }
2157 impl<'a> Default for GetArgs<'a> {
2158 #[inline]
2159 fn default() -> Self {
2160 GetArgs {
2161 key: None, fetch_contract: false,
2163 subscribe: false,
2164 }
2165 }
2166 }
2167
2168 pub struct GetBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
2169 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
2170 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
2171 }
2172 impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> GetBuilder<'a, 'b, A> {
2173 #[inline]
2174 pub fn add_key(&mut self, key: flatbuffers::WIPOffset<super::common::ContractKey<'b>>) {
2175 self.fbb_
2176 .push_slot_always::<flatbuffers::WIPOffset<super::common::ContractKey>>(
2177 Get::VT_KEY,
2178 key,
2179 );
2180 }
2181 #[inline]
2182 pub fn add_fetch_contract(&mut self, fetch_contract: bool) {
2183 self.fbb_
2184 .push_slot::<bool>(Get::VT_FETCH_CONTRACT, fetch_contract, false);
2185 }
2186 #[inline]
2187 pub fn add_subscribe(&mut self, subscribe: bool) {
2188 self.fbb_
2189 .push_slot::<bool>(Get::VT_SUBSCRIBE, subscribe, false);
2190 }
2191 #[inline]
2192 pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> GetBuilder<'a, 'b, A> {
2193 let start = _fbb.start_table();
2194 GetBuilder {
2195 fbb_: _fbb,
2196 start_: start,
2197 }
2198 }
2199 #[inline]
2200 pub fn finish(self) -> flatbuffers::WIPOffset<Get<'a>> {
2201 let o = self.fbb_.end_table(self.start_);
2202 self.fbb_.required(o, Get::VT_KEY, "key");
2203 flatbuffers::WIPOffset::new(o.value())
2204 }
2205 }
2206
2207 impl core::fmt::Debug for Get<'_> {
2208 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
2209 let mut ds = f.debug_struct("Get");
2210 ds.field("key", &self.key());
2211 ds.field("fetch_contract", &self.fetch_contract());
2212 ds.field("subscribe", &self.subscribe());
2213 ds.finish()
2214 }
2215 }
2216 pub enum SubscribeOffset {}
2217 #[derive(Copy, Clone, PartialEq)]
2218
2219 pub struct Subscribe<'a> {
2220 pub _tab: flatbuffers::Table<'a>,
2221 }
2222
2223 impl<'a> flatbuffers::Follow<'a> for Subscribe<'a> {
2224 type Inner = Subscribe<'a>;
2225 #[inline]
2226 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
2227 Self {
2228 _tab: flatbuffers::Table::new(buf, loc),
2229 }
2230 }
2231 }
2232
2233 impl<'a> Subscribe<'a> {
2234 pub const VT_KEY: flatbuffers::VOffsetT = 4;
2235 pub const VT_SUMMARY: flatbuffers::VOffsetT = 6;
2236
2237 #[inline]
2238 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
2239 Subscribe { _tab: table }
2240 }
2241 #[allow(unused_mut)]
2242 pub fn create<
2243 'bldr: 'args,
2244 'args: 'mut_bldr,
2245 'mut_bldr,
2246 A: flatbuffers::Allocator + 'bldr,
2247 >(
2248 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
2249 args: &'args SubscribeArgs<'args>,
2250 ) -> flatbuffers::WIPOffset<Subscribe<'bldr>> {
2251 let mut builder = SubscribeBuilder::new(_fbb);
2252 if let Some(x) = args.summary {
2253 builder.add_summary(x);
2254 }
2255 if let Some(x) = args.key {
2256 builder.add_key(x);
2257 }
2258 builder.finish()
2259 }
2260
2261 #[inline]
2262 pub fn key(&self) -> super::common::ContractKey<'a> {
2263 unsafe {
2267 self._tab
2268 .get::<flatbuffers::ForwardsUOffset<super::common::ContractKey>>(
2269 Subscribe::VT_KEY,
2270 None,
2271 )
2272 .unwrap()
2273 }
2274 }
2275 #[inline]
2276 pub fn summary(&self) -> Option<flatbuffers::Vector<'a, u8>> {
2277 unsafe {
2281 self._tab
2282 .get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, u8>>>(
2283 Subscribe::VT_SUMMARY,
2284 None,
2285 )
2286 }
2287 }
2288 }
2289
2290 impl flatbuffers::Verifiable for Subscribe<'_> {
2291 #[inline]
2292 fn run_verifier(
2293 v: &mut flatbuffers::Verifier,
2294 pos: usize,
2295 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
2296 use self::flatbuffers::Verifiable;
2297 v.visit_table(pos)?
2298 .visit_field::<flatbuffers::ForwardsUOffset<super::common::ContractKey>>(
2299 "key",
2300 Self::VT_KEY,
2301 true,
2302 )?
2303 .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, u8>>>(
2304 "summary",
2305 Self::VT_SUMMARY,
2306 false,
2307 )?
2308 .finish();
2309 Ok(())
2310 }
2311 }
2312 pub struct SubscribeArgs<'a> {
2313 pub key: Option<flatbuffers::WIPOffset<super::common::ContractKey<'a>>>,
2314 pub summary: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, u8>>>,
2315 }
2316 impl<'a> Default for SubscribeArgs<'a> {
2317 #[inline]
2318 fn default() -> Self {
2319 SubscribeArgs {
2320 key: None, summary: None,
2322 }
2323 }
2324 }
2325
2326 pub struct SubscribeBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
2327 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
2328 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
2329 }
2330 impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> SubscribeBuilder<'a, 'b, A> {
2331 #[inline]
2332 pub fn add_key(&mut self, key: flatbuffers::WIPOffset<super::common::ContractKey<'b>>) {
2333 self.fbb_
2334 .push_slot_always::<flatbuffers::WIPOffset<super::common::ContractKey>>(
2335 Subscribe::VT_KEY,
2336 key,
2337 );
2338 }
2339 #[inline]
2340 pub fn add_summary(
2341 &mut self,
2342 summary: flatbuffers::WIPOffset<flatbuffers::Vector<'b, u8>>,
2343 ) {
2344 self.fbb_
2345 .push_slot_always::<flatbuffers::WIPOffset<_>>(Subscribe::VT_SUMMARY, summary);
2346 }
2347 #[inline]
2348 pub fn new(
2349 _fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
2350 ) -> SubscribeBuilder<'a, 'b, A> {
2351 let start = _fbb.start_table();
2352 SubscribeBuilder {
2353 fbb_: _fbb,
2354 start_: start,
2355 }
2356 }
2357 #[inline]
2358 pub fn finish(self) -> flatbuffers::WIPOffset<Subscribe<'a>> {
2359 let o = self.fbb_.end_table(self.start_);
2360 self.fbb_.required(o, Subscribe::VT_KEY, "key");
2361 flatbuffers::WIPOffset::new(o.value())
2362 }
2363 }
2364
2365 impl core::fmt::Debug for Subscribe<'_> {
2366 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
2367 let mut ds = f.debug_struct("Subscribe");
2368 ds.field("key", &self.key());
2369 ds.field("summary", &self.summary());
2370 ds.finish()
2371 }
2372 }
2373 pub enum ClientResponseOffset {}
2374 #[derive(Copy, Clone, PartialEq)]
2375
2376 pub struct ClientResponse<'a> {
2377 pub _tab: flatbuffers::Table<'a>,
2378 }
2379
2380 impl<'a> flatbuffers::Follow<'a> for ClientResponse<'a> {
2381 type Inner = ClientResponse<'a>;
2382 #[inline]
2383 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
2384 Self {
2385 _tab: flatbuffers::Table::new(buf, loc),
2386 }
2387 }
2388 }
2389
2390 impl<'a> ClientResponse<'a> {
2391 pub const VT_DATA: flatbuffers::VOffsetT = 4;
2392
2393 #[inline]
2394 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
2395 ClientResponse { _tab: table }
2396 }
2397 #[allow(unused_mut)]
2398 pub fn create<
2399 'bldr: 'args,
2400 'args: 'mut_bldr,
2401 'mut_bldr,
2402 A: flatbuffers::Allocator + 'bldr,
2403 >(
2404 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
2405 args: &'args ClientResponseArgs<'args>,
2406 ) -> flatbuffers::WIPOffset<ClientResponse<'bldr>> {
2407 let mut builder = ClientResponseBuilder::new(_fbb);
2408 if let Some(x) = args.data {
2409 builder.add_data(x);
2410 }
2411 builder.finish()
2412 }
2413
2414 #[inline]
2415 pub fn data(&self) -> flatbuffers::Vector<'a, u8> {
2416 unsafe {
2420 self._tab
2421 .get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, u8>>>(
2422 ClientResponse::VT_DATA,
2423 None,
2424 )
2425 .unwrap()
2426 }
2427 }
2428 }
2429
2430 impl flatbuffers::Verifiable for ClientResponse<'_> {
2431 #[inline]
2432 fn run_verifier(
2433 v: &mut flatbuffers::Verifier,
2434 pos: usize,
2435 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
2436 use self::flatbuffers::Verifiable;
2437 v.visit_table(pos)?
2438 .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, u8>>>(
2439 "data",
2440 Self::VT_DATA,
2441 true,
2442 )?
2443 .finish();
2444 Ok(())
2445 }
2446 }
2447 pub struct ClientResponseArgs<'a> {
2448 pub data: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, u8>>>,
2449 }
2450 impl<'a> Default for ClientResponseArgs<'a> {
2451 #[inline]
2452 fn default() -> Self {
2453 ClientResponseArgs {
2454 data: None, }
2456 }
2457 }
2458
2459 pub struct ClientResponseBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
2460 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
2461 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
2462 }
2463 impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> ClientResponseBuilder<'a, 'b, A> {
2464 #[inline]
2465 pub fn add_data(&mut self, data: flatbuffers::WIPOffset<flatbuffers::Vector<'b, u8>>) {
2466 self.fbb_
2467 .push_slot_always::<flatbuffers::WIPOffset<_>>(ClientResponse::VT_DATA, data);
2468 }
2469 #[inline]
2470 pub fn new(
2471 _fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
2472 ) -> ClientResponseBuilder<'a, 'b, A> {
2473 let start = _fbb.start_table();
2474 ClientResponseBuilder {
2475 fbb_: _fbb,
2476 start_: start,
2477 }
2478 }
2479 #[inline]
2480 pub fn finish(self) -> flatbuffers::WIPOffset<ClientResponse<'a>> {
2481 let o = self.fbb_.end_table(self.start_);
2482 self.fbb_.required(o, ClientResponse::VT_DATA, "data");
2483 flatbuffers::WIPOffset::new(o.value())
2484 }
2485 }
2486
2487 impl core::fmt::Debug for ClientResponse<'_> {
2488 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
2489 let mut ds = f.debug_struct("ClientResponse");
2490 ds.field("data", &self.data());
2491 ds.finish()
2492 }
2493 }
2494 pub enum UserInputResponseOffset {}
2495 #[derive(Copy, Clone, PartialEq)]
2496
2497 pub struct UserInputResponse<'a> {
2498 pub _tab: flatbuffers::Table<'a>,
2499 }
2500
2501 impl<'a> flatbuffers::Follow<'a> for UserInputResponse<'a> {
2502 type Inner = UserInputResponse<'a>;
2503 #[inline]
2504 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
2505 Self {
2506 _tab: flatbuffers::Table::new(buf, loc),
2507 }
2508 }
2509 }
2510
2511 impl<'a> UserInputResponse<'a> {
2512 pub const VT_REQUEST_ID: flatbuffers::VOffsetT = 4;
2513 pub const VT_RESPONSE: flatbuffers::VOffsetT = 6;
2514 pub const VT_DELEGATE_CONTEXT: flatbuffers::VOffsetT = 8;
2515
2516 #[inline]
2517 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
2518 UserInputResponse { _tab: table }
2519 }
2520 #[allow(unused_mut)]
2521 pub fn create<
2522 'bldr: 'args,
2523 'args: 'mut_bldr,
2524 'mut_bldr,
2525 A: flatbuffers::Allocator + 'bldr,
2526 >(
2527 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
2528 args: &'args UserInputResponseArgs<'args>,
2529 ) -> flatbuffers::WIPOffset<UserInputResponse<'bldr>> {
2530 let mut builder = UserInputResponseBuilder::new(_fbb);
2531 if let Some(x) = args.delegate_context {
2532 builder.add_delegate_context(x);
2533 }
2534 if let Some(x) = args.response {
2535 builder.add_response(x);
2536 }
2537 builder.add_request_id(args.request_id);
2538 builder.finish()
2539 }
2540
2541 #[inline]
2542 pub fn request_id(&self) -> u32 {
2543 unsafe {
2547 self._tab
2548 .get::<u32>(UserInputResponse::VT_REQUEST_ID, Some(0))
2549 .unwrap()
2550 }
2551 }
2552 #[inline]
2553 pub fn response(&self) -> ClientResponse<'a> {
2554 unsafe {
2558 self._tab
2559 .get::<flatbuffers::ForwardsUOffset<ClientResponse>>(
2560 UserInputResponse::VT_RESPONSE,
2561 None,
2562 )
2563 .unwrap()
2564 }
2565 }
2566 #[inline]
2567 pub fn delegate_context(&self) -> flatbuffers::Vector<'a, u8> {
2568 unsafe {
2572 self._tab
2573 .get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, u8>>>(
2574 UserInputResponse::VT_DELEGATE_CONTEXT,
2575 None,
2576 )
2577 .unwrap()
2578 }
2579 }
2580 }
2581
2582 impl flatbuffers::Verifiable for UserInputResponse<'_> {
2583 #[inline]
2584 fn run_verifier(
2585 v: &mut flatbuffers::Verifier,
2586 pos: usize,
2587 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
2588 use self::flatbuffers::Verifiable;
2589 v.visit_table(pos)?
2590 .visit_field::<u32>("request_id", Self::VT_REQUEST_ID, false)?
2591 .visit_field::<flatbuffers::ForwardsUOffset<ClientResponse>>(
2592 "response",
2593 Self::VT_RESPONSE,
2594 true,
2595 )?
2596 .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, u8>>>(
2597 "delegate_context",
2598 Self::VT_DELEGATE_CONTEXT,
2599 true,
2600 )?
2601 .finish();
2602 Ok(())
2603 }
2604 }
2605 pub struct UserInputResponseArgs<'a> {
2606 pub request_id: u32,
2607 pub response: Option<flatbuffers::WIPOffset<ClientResponse<'a>>>,
2608 pub delegate_context: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, u8>>>,
2609 }
2610 impl<'a> Default for UserInputResponseArgs<'a> {
2611 #[inline]
2612 fn default() -> Self {
2613 UserInputResponseArgs {
2614 request_id: 0,
2615 response: None, delegate_context: None, }
2618 }
2619 }
2620
2621 pub struct UserInputResponseBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
2622 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
2623 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
2624 }
2625 impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> UserInputResponseBuilder<'a, 'b, A> {
2626 #[inline]
2627 pub fn add_request_id(&mut self, request_id: u32) {
2628 self.fbb_
2629 .push_slot::<u32>(UserInputResponse::VT_REQUEST_ID, request_id, 0);
2630 }
2631 #[inline]
2632 pub fn add_response(&mut self, response: flatbuffers::WIPOffset<ClientResponse<'b>>) {
2633 self.fbb_
2634 .push_slot_always::<flatbuffers::WIPOffset<ClientResponse>>(
2635 UserInputResponse::VT_RESPONSE,
2636 response,
2637 );
2638 }
2639 #[inline]
2640 pub fn add_delegate_context(
2641 &mut self,
2642 delegate_context: flatbuffers::WIPOffset<flatbuffers::Vector<'b, u8>>,
2643 ) {
2644 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(
2645 UserInputResponse::VT_DELEGATE_CONTEXT,
2646 delegate_context,
2647 );
2648 }
2649 #[inline]
2650 pub fn new(
2651 _fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
2652 ) -> UserInputResponseBuilder<'a, 'b, A> {
2653 let start = _fbb.start_table();
2654 UserInputResponseBuilder {
2655 fbb_: _fbb,
2656 start_: start,
2657 }
2658 }
2659 #[inline]
2660 pub fn finish(self) -> flatbuffers::WIPOffset<UserInputResponse<'a>> {
2661 let o = self.fbb_.end_table(self.start_);
2662 self.fbb_
2663 .required(o, UserInputResponse::VT_RESPONSE, "response");
2664 self.fbb_.required(
2665 o,
2666 UserInputResponse::VT_DELEGATE_CONTEXT,
2667 "delegate_context",
2668 );
2669 flatbuffers::WIPOffset::new(o.value())
2670 }
2671 }
2672
2673 impl core::fmt::Debug for UserInputResponse<'_> {
2674 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
2675 let mut ds = f.debug_struct("UserInputResponse");
2676 ds.field("request_id", &self.request_id());
2677 ds.field("response", &self.response());
2678 ds.field("delegate_context", &self.delegate_context());
2679 ds.finish()
2680 }
2681 }
2682 pub enum InboundDelegateMsgOffset {}
2683 #[derive(Copy, Clone, PartialEq)]
2684
2685 pub struct InboundDelegateMsg<'a> {
2686 pub _tab: flatbuffers::Table<'a>,
2687 }
2688
2689 impl<'a> flatbuffers::Follow<'a> for InboundDelegateMsg<'a> {
2690 type Inner = InboundDelegateMsg<'a>;
2691 #[inline]
2692 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
2693 Self {
2694 _tab: flatbuffers::Table::new(buf, loc),
2695 }
2696 }
2697 }
2698
2699 impl<'a> InboundDelegateMsg<'a> {
2700 pub const VT_INBOUND_TYPE: flatbuffers::VOffsetT = 4;
2701 pub const VT_INBOUND: flatbuffers::VOffsetT = 6;
2702
2703 #[inline]
2704 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
2705 InboundDelegateMsg { _tab: table }
2706 }
2707 #[allow(unused_mut)]
2708 pub fn create<
2709 'bldr: 'args,
2710 'args: 'mut_bldr,
2711 'mut_bldr,
2712 A: flatbuffers::Allocator + 'bldr,
2713 >(
2714 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
2715 args: &'args InboundDelegateMsgArgs,
2716 ) -> flatbuffers::WIPOffset<InboundDelegateMsg<'bldr>> {
2717 let mut builder = InboundDelegateMsgBuilder::new(_fbb);
2718 if let Some(x) = args.inbound {
2719 builder.add_inbound(x);
2720 }
2721 builder.add_inbound_type(args.inbound_type);
2722 builder.finish()
2723 }
2724
2725 #[inline]
2726 pub fn inbound_type(&self) -> InboundDelegateMsgType {
2727 unsafe {
2731 self._tab
2732 .get::<InboundDelegateMsgType>(
2733 InboundDelegateMsg::VT_INBOUND_TYPE,
2734 Some(InboundDelegateMsgType::NONE),
2735 )
2736 .unwrap()
2737 }
2738 }
2739 #[inline]
2740 pub fn inbound(&self) -> flatbuffers::Table<'a> {
2741 unsafe {
2745 self._tab
2746 .get::<flatbuffers::ForwardsUOffset<flatbuffers::Table<'a>>>(
2747 InboundDelegateMsg::VT_INBOUND,
2748 None,
2749 )
2750 .unwrap()
2751 }
2752 }
2753 #[inline]
2754 #[allow(non_snake_case)]
2755 pub fn inbound_as_common_application_message(
2756 &self,
2757 ) -> Option<super::common::ApplicationMessage<'a>> {
2758 if self.inbound_type() == InboundDelegateMsgType::common_ApplicationMessage {
2759 let u = self.inbound();
2760 Some(unsafe { super::common::ApplicationMessage::init_from_table(u) })
2764 } else {
2765 None
2766 }
2767 }
2768
2769 #[inline]
2770 #[allow(non_snake_case)]
2771 pub fn inbound_as_common_get_secret_response(
2772 &self,
2773 ) -> Option<super::common::GetSecretResponse<'a>> {
2774 if self.inbound_type() == InboundDelegateMsgType::common_GetSecretResponse {
2775 let u = self.inbound();
2776 Some(unsafe { super::common::GetSecretResponse::init_from_table(u) })
2780 } else {
2781 None
2782 }
2783 }
2784
2785 #[inline]
2786 #[allow(non_snake_case)]
2787 pub fn inbound_as_user_input_response(&self) -> Option<UserInputResponse<'a>> {
2788 if self.inbound_type() == InboundDelegateMsgType::UserInputResponse {
2789 let u = self.inbound();
2790 Some(unsafe { UserInputResponse::init_from_table(u) })
2794 } else {
2795 None
2796 }
2797 }
2798
2799 #[inline]
2800 #[allow(non_snake_case)]
2801 pub fn inbound_as_common_get_secret_request(
2802 &self,
2803 ) -> Option<super::common::GetSecretRequest<'a>> {
2804 if self.inbound_type() == InboundDelegateMsgType::common_GetSecretRequest {
2805 let u = self.inbound();
2806 Some(unsafe { super::common::GetSecretRequest::init_from_table(u) })
2810 } else {
2811 None
2812 }
2813 }
2814 }
2815
2816 impl flatbuffers::Verifiable for InboundDelegateMsg<'_> {
2817 #[inline]
2818 fn run_verifier(
2819 v: &mut flatbuffers::Verifier,
2820 pos: usize,
2821 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
2822 use self::flatbuffers::Verifiable;
2823 v.visit_table(pos)?
2824 .visit_union::<InboundDelegateMsgType, _>("inbound_type", Self::VT_INBOUND_TYPE, "inbound", Self::VT_INBOUND, true, |key, v, pos| {
2825 match key {
2826 InboundDelegateMsgType::common_ApplicationMessage => v.verify_union_variant::<flatbuffers::ForwardsUOffset<super::common::ApplicationMessage>>("InboundDelegateMsgType::common_ApplicationMessage", pos),
2827 InboundDelegateMsgType::common_GetSecretResponse => v.verify_union_variant::<flatbuffers::ForwardsUOffset<super::common::GetSecretResponse>>("InboundDelegateMsgType::common_GetSecretResponse", pos),
2828 InboundDelegateMsgType::UserInputResponse => v.verify_union_variant::<flatbuffers::ForwardsUOffset<UserInputResponse>>("InboundDelegateMsgType::UserInputResponse", pos),
2829 InboundDelegateMsgType::common_GetSecretRequest => v.verify_union_variant::<flatbuffers::ForwardsUOffset<super::common::GetSecretRequest>>("InboundDelegateMsgType::common_GetSecretRequest", pos),
2830 _ => Ok(()),
2831 }
2832 })?
2833 .finish();
2834 Ok(())
2835 }
2836 }
2837 pub struct InboundDelegateMsgArgs {
2838 pub inbound_type: InboundDelegateMsgType,
2839 pub inbound: Option<flatbuffers::WIPOffset<flatbuffers::UnionWIPOffset>>,
2840 }
2841 impl<'a> Default for InboundDelegateMsgArgs {
2842 #[inline]
2843 fn default() -> Self {
2844 InboundDelegateMsgArgs {
2845 inbound_type: InboundDelegateMsgType::NONE,
2846 inbound: None, }
2848 }
2849 }
2850
2851 pub struct InboundDelegateMsgBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
2852 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
2853 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
2854 }
2855 impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> InboundDelegateMsgBuilder<'a, 'b, A> {
2856 #[inline]
2857 pub fn add_inbound_type(&mut self, inbound_type: InboundDelegateMsgType) {
2858 self.fbb_.push_slot::<InboundDelegateMsgType>(
2859 InboundDelegateMsg::VT_INBOUND_TYPE,
2860 inbound_type,
2861 InboundDelegateMsgType::NONE,
2862 );
2863 }
2864 #[inline]
2865 pub fn add_inbound(
2866 &mut self,
2867 inbound: flatbuffers::WIPOffset<flatbuffers::UnionWIPOffset>,
2868 ) {
2869 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(
2870 InboundDelegateMsg::VT_INBOUND,
2871 inbound,
2872 );
2873 }
2874 #[inline]
2875 pub fn new(
2876 _fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
2877 ) -> InboundDelegateMsgBuilder<'a, 'b, A> {
2878 let start = _fbb.start_table();
2879 InboundDelegateMsgBuilder {
2880 fbb_: _fbb,
2881 start_: start,
2882 }
2883 }
2884 #[inline]
2885 pub fn finish(self) -> flatbuffers::WIPOffset<InboundDelegateMsg<'a>> {
2886 let o = self.fbb_.end_table(self.start_);
2887 self.fbb_
2888 .required(o, InboundDelegateMsg::VT_INBOUND, "inbound");
2889 flatbuffers::WIPOffset::new(o.value())
2890 }
2891 }
2892
2893 impl core::fmt::Debug for InboundDelegateMsg<'_> {
2894 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
2895 let mut ds = f.debug_struct("InboundDelegateMsg");
2896 ds.field("inbound_type", &self.inbound_type());
2897 match self.inbound_type() {
2898 InboundDelegateMsgType::common_ApplicationMessage => {
2899 if let Some(x) = self.inbound_as_common_application_message() {
2900 ds.field("inbound", &x)
2901 } else {
2902 ds.field(
2903 "inbound",
2904 &"InvalidFlatbuffer: Union discriminant does not match value.",
2905 )
2906 }
2907 }
2908 InboundDelegateMsgType::common_GetSecretResponse => {
2909 if let Some(x) = self.inbound_as_common_get_secret_response() {
2910 ds.field("inbound", &x)
2911 } else {
2912 ds.field(
2913 "inbound",
2914 &"InvalidFlatbuffer: Union discriminant does not match value.",
2915 )
2916 }
2917 }
2918 InboundDelegateMsgType::UserInputResponse => {
2919 if let Some(x) = self.inbound_as_user_input_response() {
2920 ds.field("inbound", &x)
2921 } else {
2922 ds.field(
2923 "inbound",
2924 &"InvalidFlatbuffer: Union discriminant does not match value.",
2925 )
2926 }
2927 }
2928 InboundDelegateMsgType::common_GetSecretRequest => {
2929 if let Some(x) = self.inbound_as_common_get_secret_request() {
2930 ds.field("inbound", &x)
2931 } else {
2932 ds.field(
2933 "inbound",
2934 &"InvalidFlatbuffer: Union discriminant does not match value.",
2935 )
2936 }
2937 }
2938 _ => {
2939 let x: Option<()> = None;
2940 ds.field("inbound", &x)
2941 }
2942 };
2943 ds.finish()
2944 }
2945 }
2946 pub enum ApplicationMessagesOffset {}
2947 #[derive(Copy, Clone, PartialEq)]
2948
2949 pub struct ApplicationMessages<'a> {
2950 pub _tab: flatbuffers::Table<'a>,
2951 }
2952
2953 impl<'a> flatbuffers::Follow<'a> for ApplicationMessages<'a> {
2954 type Inner = ApplicationMessages<'a>;
2955 #[inline]
2956 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
2957 Self {
2958 _tab: flatbuffers::Table::new(buf, loc),
2959 }
2960 }
2961 }
2962
2963 impl<'a> ApplicationMessages<'a> {
2964 pub const VT_KEY: flatbuffers::VOffsetT = 4;
2965 pub const VT_PARAMS: flatbuffers::VOffsetT = 6;
2966 pub const VT_INBOUND: flatbuffers::VOffsetT = 8;
2967
2968 #[inline]
2969 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
2970 ApplicationMessages { _tab: table }
2971 }
2972 #[allow(unused_mut)]
2973 pub fn create<
2974 'bldr: 'args,
2975 'args: 'mut_bldr,
2976 'mut_bldr,
2977 A: flatbuffers::Allocator + 'bldr,
2978 >(
2979 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
2980 args: &'args ApplicationMessagesArgs<'args>,
2981 ) -> flatbuffers::WIPOffset<ApplicationMessages<'bldr>> {
2982 let mut builder = ApplicationMessagesBuilder::new(_fbb);
2983 if let Some(x) = args.inbound {
2984 builder.add_inbound(x);
2985 }
2986 if let Some(x) = args.params {
2987 builder.add_params(x);
2988 }
2989 if let Some(x) = args.key {
2990 builder.add_key(x);
2991 }
2992 builder.finish()
2993 }
2994
2995 #[inline]
2996 pub fn key(&self) -> DelegateKey<'a> {
2997 unsafe {
3001 self._tab
3002 .get::<flatbuffers::ForwardsUOffset<DelegateKey>>(
3003 ApplicationMessages::VT_KEY,
3004 None,
3005 )
3006 .unwrap()
3007 }
3008 }
3009 #[inline]
3010 pub fn params(&self) -> flatbuffers::Vector<'a, u8> {
3011 unsafe {
3015 self._tab
3016 .get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, u8>>>(
3017 ApplicationMessages::VT_PARAMS,
3018 None,
3019 )
3020 .unwrap()
3021 }
3022 }
3023 #[inline]
3024 pub fn inbound(
3025 &self,
3026 ) -> flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<InboundDelegateMsg<'a>>> {
3027 unsafe {
3031 self._tab
3032 .get::<flatbuffers::ForwardsUOffset<
3033 flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<InboundDelegateMsg>>,
3034 >>(ApplicationMessages::VT_INBOUND, None)
3035 .unwrap()
3036 }
3037 }
3038 }
3039
3040 impl flatbuffers::Verifiable for ApplicationMessages<'_> {
3041 #[inline]
3042 fn run_verifier(
3043 v: &mut flatbuffers::Verifier,
3044 pos: usize,
3045 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
3046 use self::flatbuffers::Verifiable;
3047 v.visit_table(pos)?
3048 .visit_field::<flatbuffers::ForwardsUOffset<DelegateKey>>(
3049 "key",
3050 Self::VT_KEY,
3051 true,
3052 )?
3053 .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, u8>>>(
3054 "params",
3055 Self::VT_PARAMS,
3056 true,
3057 )?
3058 .visit_field::<flatbuffers::ForwardsUOffset<
3059 flatbuffers::Vector<'_, flatbuffers::ForwardsUOffset<InboundDelegateMsg>>,
3060 >>("inbound", Self::VT_INBOUND, true)?
3061 .finish();
3062 Ok(())
3063 }
3064 }
3065 pub struct ApplicationMessagesArgs<'a> {
3066 pub key: Option<flatbuffers::WIPOffset<DelegateKey<'a>>>,
3067 pub params: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, u8>>>,
3068 pub inbound: Option<
3069 flatbuffers::WIPOffset<
3070 flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<InboundDelegateMsg<'a>>>,
3071 >,
3072 >,
3073 }
3074 impl<'a> Default for ApplicationMessagesArgs<'a> {
3075 #[inline]
3076 fn default() -> Self {
3077 ApplicationMessagesArgs {
3078 key: None, params: None, inbound: None, }
3082 }
3083 }
3084
3085 pub struct ApplicationMessagesBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
3086 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
3087 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
3088 }
3089 impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> ApplicationMessagesBuilder<'a, 'b, A> {
3090 #[inline]
3091 pub fn add_key(&mut self, key: flatbuffers::WIPOffset<DelegateKey<'b>>) {
3092 self.fbb_
3093 .push_slot_always::<flatbuffers::WIPOffset<DelegateKey>>(
3094 ApplicationMessages::VT_KEY,
3095 key,
3096 );
3097 }
3098 #[inline]
3099 pub fn add_params(&mut self, params: flatbuffers::WIPOffset<flatbuffers::Vector<'b, u8>>) {
3100 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(
3101 ApplicationMessages::VT_PARAMS,
3102 params,
3103 );
3104 }
3105 #[inline]
3106 pub fn add_inbound(
3107 &mut self,
3108 inbound: flatbuffers::WIPOffset<
3109 flatbuffers::Vector<'b, flatbuffers::ForwardsUOffset<InboundDelegateMsg<'b>>>,
3110 >,
3111 ) {
3112 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(
3113 ApplicationMessages::VT_INBOUND,
3114 inbound,
3115 );
3116 }
3117 #[inline]
3118 pub fn new(
3119 _fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
3120 ) -> ApplicationMessagesBuilder<'a, 'b, A> {
3121 let start = _fbb.start_table();
3122 ApplicationMessagesBuilder {
3123 fbb_: _fbb,
3124 start_: start,
3125 }
3126 }
3127 #[inline]
3128 pub fn finish(self) -> flatbuffers::WIPOffset<ApplicationMessages<'a>> {
3129 let o = self.fbb_.end_table(self.start_);
3130 self.fbb_.required(o, ApplicationMessages::VT_KEY, "key");
3131 self.fbb_
3132 .required(o, ApplicationMessages::VT_PARAMS, "params");
3133 self.fbb_
3134 .required(o, ApplicationMessages::VT_INBOUND, "inbound");
3135 flatbuffers::WIPOffset::new(o.value())
3136 }
3137 }
3138
3139 impl core::fmt::Debug for ApplicationMessages<'_> {
3140 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
3141 let mut ds = f.debug_struct("ApplicationMessages");
3142 ds.field("key", &self.key());
3143 ds.field("params", &self.params());
3144 ds.field("inbound", &self.inbound());
3145 ds.finish()
3146 }
3147 }
3148 pub enum GetSecretRequestTypeOffset {}
3149 #[derive(Copy, Clone, PartialEq)]
3150
3151 pub struct GetSecretRequestType<'a> {
3152 pub _tab: flatbuffers::Table<'a>,
3153 }
3154
3155 impl<'a> flatbuffers::Follow<'a> for GetSecretRequestType<'a> {
3156 type Inner = GetSecretRequestType<'a>;
3157 #[inline]
3158 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
3159 Self {
3160 _tab: flatbuffers::Table::new(buf, loc),
3161 }
3162 }
3163 }
3164
3165 impl<'a> GetSecretRequestType<'a> {
3166 pub const VT_KEY: flatbuffers::VOffsetT = 4;
3167 pub const VT_PARAMS: flatbuffers::VOffsetT = 6;
3168 pub const VT_GET_REQUEST: flatbuffers::VOffsetT = 8;
3169
3170 #[inline]
3171 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
3172 GetSecretRequestType { _tab: table }
3173 }
3174 #[allow(unused_mut)]
3175 pub fn create<
3176 'bldr: 'args,
3177 'args: 'mut_bldr,
3178 'mut_bldr,
3179 A: flatbuffers::Allocator + 'bldr,
3180 >(
3181 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
3182 args: &'args GetSecretRequestTypeArgs<'args>,
3183 ) -> flatbuffers::WIPOffset<GetSecretRequestType<'bldr>> {
3184 let mut builder = GetSecretRequestTypeBuilder::new(_fbb);
3185 if let Some(x) = args.get_request {
3186 builder.add_get_request(x);
3187 }
3188 if let Some(x) = args.params {
3189 builder.add_params(x);
3190 }
3191 if let Some(x) = args.key {
3192 builder.add_key(x);
3193 }
3194 builder.finish()
3195 }
3196
3197 #[inline]
3198 pub fn key(&self) -> DelegateKey<'a> {
3199 unsafe {
3203 self._tab
3204 .get::<flatbuffers::ForwardsUOffset<DelegateKey>>(
3205 GetSecretRequestType::VT_KEY,
3206 None,
3207 )
3208 .unwrap()
3209 }
3210 }
3211 #[inline]
3212 pub fn params(&self) -> flatbuffers::Vector<'a, u8> {
3213 unsafe {
3217 self._tab
3218 .get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, u8>>>(
3219 GetSecretRequestType::VT_PARAMS,
3220 None,
3221 )
3222 .unwrap()
3223 }
3224 }
3225 #[inline]
3226 pub fn get_request(&self) -> super::common::GetSecretRequest<'a> {
3227 unsafe {
3231 self._tab
3232 .get::<flatbuffers::ForwardsUOffset<super::common::GetSecretRequest>>(
3233 GetSecretRequestType::VT_GET_REQUEST,
3234 None,
3235 )
3236 .unwrap()
3237 }
3238 }
3239 }
3240
3241 impl flatbuffers::Verifiable for GetSecretRequestType<'_> {
3242 #[inline]
3243 fn run_verifier(
3244 v: &mut flatbuffers::Verifier,
3245 pos: usize,
3246 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
3247 use self::flatbuffers::Verifiable;
3248 v.visit_table(pos)?
3249 .visit_field::<flatbuffers::ForwardsUOffset<DelegateKey>>(
3250 "key",
3251 Self::VT_KEY,
3252 true,
3253 )?
3254 .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, u8>>>(
3255 "params",
3256 Self::VT_PARAMS,
3257 true,
3258 )?
3259 .visit_field::<flatbuffers::ForwardsUOffset<super::common::GetSecretRequest>>(
3260 "get_request",
3261 Self::VT_GET_REQUEST,
3262 true,
3263 )?
3264 .finish();
3265 Ok(())
3266 }
3267 }
3268 pub struct GetSecretRequestTypeArgs<'a> {
3269 pub key: Option<flatbuffers::WIPOffset<DelegateKey<'a>>>,
3270 pub params: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, u8>>>,
3271 pub get_request: Option<flatbuffers::WIPOffset<super::common::GetSecretRequest<'a>>>,
3272 }
3273 impl<'a> Default for GetSecretRequestTypeArgs<'a> {
3274 #[inline]
3275 fn default() -> Self {
3276 GetSecretRequestTypeArgs {
3277 key: None, params: None, get_request: None, }
3281 }
3282 }
3283
3284 pub struct GetSecretRequestTypeBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
3285 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
3286 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
3287 }
3288 impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> GetSecretRequestTypeBuilder<'a, 'b, A> {
3289 #[inline]
3290 pub fn add_key(&mut self, key: flatbuffers::WIPOffset<DelegateKey<'b>>) {
3291 self.fbb_
3292 .push_slot_always::<flatbuffers::WIPOffset<DelegateKey>>(
3293 GetSecretRequestType::VT_KEY,
3294 key,
3295 );
3296 }
3297 #[inline]
3298 pub fn add_params(&mut self, params: flatbuffers::WIPOffset<flatbuffers::Vector<'b, u8>>) {
3299 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(
3300 GetSecretRequestType::VT_PARAMS,
3301 params,
3302 );
3303 }
3304 #[inline]
3305 pub fn add_get_request(
3306 &mut self,
3307 get_request: flatbuffers::WIPOffset<super::common::GetSecretRequest<'b>>,
3308 ) {
3309 self.fbb_
3310 .push_slot_always::<flatbuffers::WIPOffset<super::common::GetSecretRequest>>(
3311 GetSecretRequestType::VT_GET_REQUEST,
3312 get_request,
3313 );
3314 }
3315 #[inline]
3316 pub fn new(
3317 _fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
3318 ) -> GetSecretRequestTypeBuilder<'a, 'b, A> {
3319 let start = _fbb.start_table();
3320 GetSecretRequestTypeBuilder {
3321 fbb_: _fbb,
3322 start_: start,
3323 }
3324 }
3325 #[inline]
3326 pub fn finish(self) -> flatbuffers::WIPOffset<GetSecretRequestType<'a>> {
3327 let o = self.fbb_.end_table(self.start_);
3328 self.fbb_.required(o, GetSecretRequestType::VT_KEY, "key");
3329 self.fbb_
3330 .required(o, GetSecretRequestType::VT_PARAMS, "params");
3331 self.fbb_
3332 .required(o, GetSecretRequestType::VT_GET_REQUEST, "get_request");
3333 flatbuffers::WIPOffset::new(o.value())
3334 }
3335 }
3336
3337 impl core::fmt::Debug for GetSecretRequestType<'_> {
3338 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
3339 let mut ds = f.debug_struct("GetSecretRequestType");
3340 ds.field("key", &self.key());
3341 ds.field("params", &self.params());
3342 ds.field("get_request", &self.get_request());
3343 ds.finish()
3344 }
3345 }
3346 pub enum RegisterDelegateOffset {}
3347 #[derive(Copy, Clone, PartialEq)]
3348
3349 pub struct RegisterDelegate<'a> {
3350 pub _tab: flatbuffers::Table<'a>,
3351 }
3352
3353 impl<'a> flatbuffers::Follow<'a> for RegisterDelegate<'a> {
3354 type Inner = RegisterDelegate<'a>;
3355 #[inline]
3356 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
3357 Self {
3358 _tab: flatbuffers::Table::new(buf, loc),
3359 }
3360 }
3361 }
3362
3363 impl<'a> RegisterDelegate<'a> {
3364 pub const VT_DELEGATE: flatbuffers::VOffsetT = 4;
3365 pub const VT_CIPHER: flatbuffers::VOffsetT = 6;
3366 pub const VT_NONCE: flatbuffers::VOffsetT = 8;
3367
3368 #[inline]
3369 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
3370 RegisterDelegate { _tab: table }
3371 }
3372 #[allow(unused_mut)]
3373 pub fn create<
3374 'bldr: 'args,
3375 'args: 'mut_bldr,
3376 'mut_bldr,
3377 A: flatbuffers::Allocator + 'bldr,
3378 >(
3379 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
3380 args: &'args RegisterDelegateArgs<'args>,
3381 ) -> flatbuffers::WIPOffset<RegisterDelegate<'bldr>> {
3382 let mut builder = RegisterDelegateBuilder::new(_fbb);
3383 if let Some(x) = args.nonce {
3384 builder.add_nonce(x);
3385 }
3386 if let Some(x) = args.cipher {
3387 builder.add_cipher(x);
3388 }
3389 if let Some(x) = args.delegate {
3390 builder.add_delegate(x);
3391 }
3392 builder.finish()
3393 }
3394
3395 #[inline]
3396 pub fn delegate(&self) -> DelegateContainer<'a> {
3397 unsafe {
3401 self._tab
3402 .get::<flatbuffers::ForwardsUOffset<DelegateContainer>>(
3403 RegisterDelegate::VT_DELEGATE,
3404 None,
3405 )
3406 .unwrap()
3407 }
3408 }
3409 #[inline]
3410 pub fn cipher(&self) -> flatbuffers::Vector<'a, u8> {
3411 unsafe {
3415 self._tab
3416 .get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, u8>>>(
3417 RegisterDelegate::VT_CIPHER,
3418 None,
3419 )
3420 .unwrap()
3421 }
3422 }
3423 #[inline]
3424 pub fn nonce(&self) -> flatbuffers::Vector<'a, u8> {
3425 unsafe {
3429 self._tab
3430 .get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, u8>>>(
3431 RegisterDelegate::VT_NONCE,
3432 None,
3433 )
3434 .unwrap()
3435 }
3436 }
3437 }
3438
3439 impl flatbuffers::Verifiable for RegisterDelegate<'_> {
3440 #[inline]
3441 fn run_verifier(
3442 v: &mut flatbuffers::Verifier,
3443 pos: usize,
3444 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
3445 use self::flatbuffers::Verifiable;
3446 v.visit_table(pos)?
3447 .visit_field::<flatbuffers::ForwardsUOffset<DelegateContainer>>(
3448 "delegate",
3449 Self::VT_DELEGATE,
3450 true,
3451 )?
3452 .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, u8>>>(
3453 "cipher",
3454 Self::VT_CIPHER,
3455 true,
3456 )?
3457 .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, u8>>>(
3458 "nonce",
3459 Self::VT_NONCE,
3460 true,
3461 )?
3462 .finish();
3463 Ok(())
3464 }
3465 }
3466 pub struct RegisterDelegateArgs<'a> {
3467 pub delegate: Option<flatbuffers::WIPOffset<DelegateContainer<'a>>>,
3468 pub cipher: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, u8>>>,
3469 pub nonce: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, u8>>>,
3470 }
3471 impl<'a> Default for RegisterDelegateArgs<'a> {
3472 #[inline]
3473 fn default() -> Self {
3474 RegisterDelegateArgs {
3475 delegate: None, cipher: None, nonce: None, }
3479 }
3480 }
3481
3482 pub struct RegisterDelegateBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
3483 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
3484 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
3485 }
3486 impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> RegisterDelegateBuilder<'a, 'b, A> {
3487 #[inline]
3488 pub fn add_delegate(&mut self, delegate: flatbuffers::WIPOffset<DelegateContainer<'b>>) {
3489 self.fbb_
3490 .push_slot_always::<flatbuffers::WIPOffset<DelegateContainer>>(
3491 RegisterDelegate::VT_DELEGATE,
3492 delegate,
3493 );
3494 }
3495 #[inline]
3496 pub fn add_cipher(&mut self, cipher: flatbuffers::WIPOffset<flatbuffers::Vector<'b, u8>>) {
3497 self.fbb_
3498 .push_slot_always::<flatbuffers::WIPOffset<_>>(RegisterDelegate::VT_CIPHER, cipher);
3499 }
3500 #[inline]
3501 pub fn add_nonce(&mut self, nonce: flatbuffers::WIPOffset<flatbuffers::Vector<'b, u8>>) {
3502 self.fbb_
3503 .push_slot_always::<flatbuffers::WIPOffset<_>>(RegisterDelegate::VT_NONCE, nonce);
3504 }
3505 #[inline]
3506 pub fn new(
3507 _fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
3508 ) -> RegisterDelegateBuilder<'a, 'b, A> {
3509 let start = _fbb.start_table();
3510 RegisterDelegateBuilder {
3511 fbb_: _fbb,
3512 start_: start,
3513 }
3514 }
3515 #[inline]
3516 pub fn finish(self) -> flatbuffers::WIPOffset<RegisterDelegate<'a>> {
3517 let o = self.fbb_.end_table(self.start_);
3518 self.fbb_
3519 .required(o, RegisterDelegate::VT_DELEGATE, "delegate");
3520 self.fbb_.required(o, RegisterDelegate::VT_CIPHER, "cipher");
3521 self.fbb_.required(o, RegisterDelegate::VT_NONCE, "nonce");
3522 flatbuffers::WIPOffset::new(o.value())
3523 }
3524 }
3525
3526 impl core::fmt::Debug for RegisterDelegate<'_> {
3527 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
3528 let mut ds = f.debug_struct("RegisterDelegate");
3529 ds.field("delegate", &self.delegate());
3530 ds.field("cipher", &self.cipher());
3531 ds.field("nonce", &self.nonce());
3532 ds.finish()
3533 }
3534 }
3535 pub enum UnregisterDelegateOffset {}
3536 #[derive(Copy, Clone, PartialEq)]
3537
3538 pub struct UnregisterDelegate<'a> {
3539 pub _tab: flatbuffers::Table<'a>,
3540 }
3541
3542 impl<'a> flatbuffers::Follow<'a> for UnregisterDelegate<'a> {
3543 type Inner = UnregisterDelegate<'a>;
3544 #[inline]
3545 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
3546 Self {
3547 _tab: flatbuffers::Table::new(buf, loc),
3548 }
3549 }
3550 }
3551
3552 impl<'a> UnregisterDelegate<'a> {
3553 pub const VT_KEY: flatbuffers::VOffsetT = 4;
3554
3555 #[inline]
3556 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
3557 UnregisterDelegate { _tab: table }
3558 }
3559 #[allow(unused_mut)]
3560 pub fn create<
3561 'bldr: 'args,
3562 'args: 'mut_bldr,
3563 'mut_bldr,
3564 A: flatbuffers::Allocator + 'bldr,
3565 >(
3566 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
3567 args: &'args UnregisterDelegateArgs<'args>,
3568 ) -> flatbuffers::WIPOffset<UnregisterDelegate<'bldr>> {
3569 let mut builder = UnregisterDelegateBuilder::new(_fbb);
3570 if let Some(x) = args.key {
3571 builder.add_key(x);
3572 }
3573 builder.finish()
3574 }
3575
3576 #[inline]
3577 pub fn key(&self) -> DelegateKey<'a> {
3578 unsafe {
3582 self._tab
3583 .get::<flatbuffers::ForwardsUOffset<DelegateKey>>(
3584 UnregisterDelegate::VT_KEY,
3585 None,
3586 )
3587 .unwrap()
3588 }
3589 }
3590 }
3591
3592 impl flatbuffers::Verifiable for UnregisterDelegate<'_> {
3593 #[inline]
3594 fn run_verifier(
3595 v: &mut flatbuffers::Verifier,
3596 pos: usize,
3597 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
3598 use self::flatbuffers::Verifiable;
3599 v.visit_table(pos)?
3600 .visit_field::<flatbuffers::ForwardsUOffset<DelegateKey>>(
3601 "key",
3602 Self::VT_KEY,
3603 true,
3604 )?
3605 .finish();
3606 Ok(())
3607 }
3608 }
3609 pub struct UnregisterDelegateArgs<'a> {
3610 pub key: Option<flatbuffers::WIPOffset<DelegateKey<'a>>>,
3611 }
3612 impl<'a> Default for UnregisterDelegateArgs<'a> {
3613 #[inline]
3614 fn default() -> Self {
3615 UnregisterDelegateArgs {
3616 key: None, }
3618 }
3619 }
3620
3621 pub struct UnregisterDelegateBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
3622 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
3623 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
3624 }
3625 impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> UnregisterDelegateBuilder<'a, 'b, A> {
3626 #[inline]
3627 pub fn add_key(&mut self, key: flatbuffers::WIPOffset<DelegateKey<'b>>) {
3628 self.fbb_
3629 .push_slot_always::<flatbuffers::WIPOffset<DelegateKey>>(
3630 UnregisterDelegate::VT_KEY,
3631 key,
3632 );
3633 }
3634 #[inline]
3635 pub fn new(
3636 _fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
3637 ) -> UnregisterDelegateBuilder<'a, 'b, A> {
3638 let start = _fbb.start_table();
3639 UnregisterDelegateBuilder {
3640 fbb_: _fbb,
3641 start_: start,
3642 }
3643 }
3644 #[inline]
3645 pub fn finish(self) -> flatbuffers::WIPOffset<UnregisterDelegate<'a>> {
3646 let o = self.fbb_.end_table(self.start_);
3647 self.fbb_.required(o, UnregisterDelegate::VT_KEY, "key");
3648 flatbuffers::WIPOffset::new(o.value())
3649 }
3650 }
3651
3652 impl core::fmt::Debug for UnregisterDelegate<'_> {
3653 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
3654 let mut ds = f.debug_struct("UnregisterDelegate");
3655 ds.field("key", &self.key());
3656 ds.finish()
3657 }
3658 }
3659 pub enum ContractRequestOffset {}
3660 #[derive(Copy, Clone, PartialEq)]
3661
3662 pub struct ContractRequest<'a> {
3663 pub _tab: flatbuffers::Table<'a>,
3664 }
3665
3666 impl<'a> flatbuffers::Follow<'a> for ContractRequest<'a> {
3667 type Inner = ContractRequest<'a>;
3668 #[inline]
3669 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
3670 Self {
3671 _tab: flatbuffers::Table::new(buf, loc),
3672 }
3673 }
3674 }
3675
3676 impl<'a> ContractRequest<'a> {
3677 pub const VT_CONTRACT_REQUEST_TYPE: flatbuffers::VOffsetT = 4;
3678 pub const VT_CONTRACT_REQUEST: flatbuffers::VOffsetT = 6;
3679
3680 #[inline]
3681 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
3682 ContractRequest { _tab: table }
3683 }
3684 #[allow(unused_mut)]
3685 pub fn create<
3686 'bldr: 'args,
3687 'args: 'mut_bldr,
3688 'mut_bldr,
3689 A: flatbuffers::Allocator + 'bldr,
3690 >(
3691 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
3692 args: &'args ContractRequestArgs,
3693 ) -> flatbuffers::WIPOffset<ContractRequest<'bldr>> {
3694 let mut builder = ContractRequestBuilder::new(_fbb);
3695 if let Some(x) = args.contract_request {
3696 builder.add_contract_request(x);
3697 }
3698 builder.add_contract_request_type(args.contract_request_type);
3699 builder.finish()
3700 }
3701
3702 #[inline]
3703 pub fn contract_request_type(&self) -> ContractRequestType {
3704 unsafe {
3708 self._tab
3709 .get::<ContractRequestType>(
3710 ContractRequest::VT_CONTRACT_REQUEST_TYPE,
3711 Some(ContractRequestType::NONE),
3712 )
3713 .unwrap()
3714 }
3715 }
3716 #[inline]
3717 pub fn contract_request(&self) -> flatbuffers::Table<'a> {
3718 unsafe {
3722 self._tab
3723 .get::<flatbuffers::ForwardsUOffset<flatbuffers::Table<'a>>>(
3724 ContractRequest::VT_CONTRACT_REQUEST,
3725 None,
3726 )
3727 .unwrap()
3728 }
3729 }
3730 #[inline]
3731 #[allow(non_snake_case)]
3732 pub fn contract_request_as_put(&self) -> Option<Put<'a>> {
3733 if self.contract_request_type() == ContractRequestType::Put {
3734 let u = self.contract_request();
3735 Some(unsafe { Put::init_from_table(u) })
3739 } else {
3740 None
3741 }
3742 }
3743
3744 #[inline]
3745 #[allow(non_snake_case)]
3746 pub fn contract_request_as_update(&self) -> Option<Update<'a>> {
3747 if self.contract_request_type() == ContractRequestType::Update {
3748 let u = self.contract_request();
3749 Some(unsafe { Update::init_from_table(u) })
3753 } else {
3754 None
3755 }
3756 }
3757
3758 #[inline]
3759 #[allow(non_snake_case)]
3760 pub fn contract_request_as_get(&self) -> Option<Get<'a>> {
3761 if self.contract_request_type() == ContractRequestType::Get {
3762 let u = self.contract_request();
3763 Some(unsafe { Get::init_from_table(u) })
3767 } else {
3768 None
3769 }
3770 }
3771
3772 #[inline]
3773 #[allow(non_snake_case)]
3774 pub fn contract_request_as_subscribe(&self) -> Option<Subscribe<'a>> {
3775 if self.contract_request_type() == ContractRequestType::Subscribe {
3776 let u = self.contract_request();
3777 Some(unsafe { Subscribe::init_from_table(u) })
3781 } else {
3782 None
3783 }
3784 }
3785 }
3786
3787 impl flatbuffers::Verifiable for ContractRequest<'_> {
3788 #[inline]
3789 fn run_verifier(
3790 v: &mut flatbuffers::Verifier,
3791 pos: usize,
3792 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
3793 use self::flatbuffers::Verifiable;
3794 v.visit_table(pos)?
3795 .visit_union::<ContractRequestType, _>(
3796 "contract_request_type",
3797 Self::VT_CONTRACT_REQUEST_TYPE,
3798 "contract_request",
3799 Self::VT_CONTRACT_REQUEST,
3800 true,
3801 |key, v, pos| match key {
3802 ContractRequestType::Put => v
3803 .verify_union_variant::<flatbuffers::ForwardsUOffset<Put>>(
3804 "ContractRequestType::Put",
3805 pos,
3806 ),
3807 ContractRequestType::Update => v
3808 .verify_union_variant::<flatbuffers::ForwardsUOffset<Update>>(
3809 "ContractRequestType::Update",
3810 pos,
3811 ),
3812 ContractRequestType::Get => v
3813 .verify_union_variant::<flatbuffers::ForwardsUOffset<Get>>(
3814 "ContractRequestType::Get",
3815 pos,
3816 ),
3817 ContractRequestType::Subscribe => v
3818 .verify_union_variant::<flatbuffers::ForwardsUOffset<Subscribe>>(
3819 "ContractRequestType::Subscribe",
3820 pos,
3821 ),
3822 _ => Ok(()),
3823 },
3824 )?
3825 .finish();
3826 Ok(())
3827 }
3828 }
3829 pub struct ContractRequestArgs {
3830 pub contract_request_type: ContractRequestType,
3831 pub contract_request: Option<flatbuffers::WIPOffset<flatbuffers::UnionWIPOffset>>,
3832 }
3833 impl<'a> Default for ContractRequestArgs {
3834 #[inline]
3835 fn default() -> Self {
3836 ContractRequestArgs {
3837 contract_request_type: ContractRequestType::NONE,
3838 contract_request: None, }
3840 }
3841 }
3842
3843 pub struct ContractRequestBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
3844 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
3845 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
3846 }
3847 impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> ContractRequestBuilder<'a, 'b, A> {
3848 #[inline]
3849 pub fn add_contract_request_type(&mut self, contract_request_type: ContractRequestType) {
3850 self.fbb_.push_slot::<ContractRequestType>(
3851 ContractRequest::VT_CONTRACT_REQUEST_TYPE,
3852 contract_request_type,
3853 ContractRequestType::NONE,
3854 );
3855 }
3856 #[inline]
3857 pub fn add_contract_request(
3858 &mut self,
3859 contract_request: flatbuffers::WIPOffset<flatbuffers::UnionWIPOffset>,
3860 ) {
3861 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(
3862 ContractRequest::VT_CONTRACT_REQUEST,
3863 contract_request,
3864 );
3865 }
3866 #[inline]
3867 pub fn new(
3868 _fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
3869 ) -> ContractRequestBuilder<'a, 'b, A> {
3870 let start = _fbb.start_table();
3871 ContractRequestBuilder {
3872 fbb_: _fbb,
3873 start_: start,
3874 }
3875 }
3876 #[inline]
3877 pub fn finish(self) -> flatbuffers::WIPOffset<ContractRequest<'a>> {
3878 let o = self.fbb_.end_table(self.start_);
3879 self.fbb_
3880 .required(o, ContractRequest::VT_CONTRACT_REQUEST, "contract_request");
3881 flatbuffers::WIPOffset::new(o.value())
3882 }
3883 }
3884
3885 impl core::fmt::Debug for ContractRequest<'_> {
3886 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
3887 let mut ds = f.debug_struct("ContractRequest");
3888 ds.field("contract_request_type", &self.contract_request_type());
3889 match self.contract_request_type() {
3890 ContractRequestType::Put => {
3891 if let Some(x) = self.contract_request_as_put() {
3892 ds.field("contract_request", &x)
3893 } else {
3894 ds.field(
3895 "contract_request",
3896 &"InvalidFlatbuffer: Union discriminant does not match value.",
3897 )
3898 }
3899 }
3900 ContractRequestType::Update => {
3901 if let Some(x) = self.contract_request_as_update() {
3902 ds.field("contract_request", &x)
3903 } else {
3904 ds.field(
3905 "contract_request",
3906 &"InvalidFlatbuffer: Union discriminant does not match value.",
3907 )
3908 }
3909 }
3910 ContractRequestType::Get => {
3911 if let Some(x) = self.contract_request_as_get() {
3912 ds.field("contract_request", &x)
3913 } else {
3914 ds.field(
3915 "contract_request",
3916 &"InvalidFlatbuffer: Union discriminant does not match value.",
3917 )
3918 }
3919 }
3920 ContractRequestType::Subscribe => {
3921 if let Some(x) = self.contract_request_as_subscribe() {
3922 ds.field("contract_request", &x)
3923 } else {
3924 ds.field(
3925 "contract_request",
3926 &"InvalidFlatbuffer: Union discriminant does not match value.",
3927 )
3928 }
3929 }
3930 _ => {
3931 let x: Option<()> = None;
3932 ds.field("contract_request", &x)
3933 }
3934 };
3935 ds.finish()
3936 }
3937 }
3938 pub enum DelegateRequestOffset {}
3939 #[derive(Copy, Clone, PartialEq)]
3940
3941 pub struct DelegateRequest<'a> {
3942 pub _tab: flatbuffers::Table<'a>,
3943 }
3944
3945 impl<'a> flatbuffers::Follow<'a> for DelegateRequest<'a> {
3946 type Inner = DelegateRequest<'a>;
3947 #[inline]
3948 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
3949 Self {
3950 _tab: flatbuffers::Table::new(buf, loc),
3951 }
3952 }
3953 }
3954
3955 impl<'a> DelegateRequest<'a> {
3956 pub const VT_DELEGATE_REQUEST_TYPE: flatbuffers::VOffsetT = 4;
3957 pub const VT_DELEGATE_REQUEST: flatbuffers::VOffsetT = 6;
3958
3959 #[inline]
3960 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
3961 DelegateRequest { _tab: table }
3962 }
3963 #[allow(unused_mut)]
3964 pub fn create<
3965 'bldr: 'args,
3966 'args: 'mut_bldr,
3967 'mut_bldr,
3968 A: flatbuffers::Allocator + 'bldr,
3969 >(
3970 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
3971 args: &'args DelegateRequestArgs,
3972 ) -> flatbuffers::WIPOffset<DelegateRequest<'bldr>> {
3973 let mut builder = DelegateRequestBuilder::new(_fbb);
3974 if let Some(x) = args.delegate_request {
3975 builder.add_delegate_request(x);
3976 }
3977 builder.add_delegate_request_type(args.delegate_request_type);
3978 builder.finish()
3979 }
3980
3981 #[inline]
3982 pub fn delegate_request_type(&self) -> DelegateRequestType {
3983 unsafe {
3987 self._tab
3988 .get::<DelegateRequestType>(
3989 DelegateRequest::VT_DELEGATE_REQUEST_TYPE,
3990 Some(DelegateRequestType::NONE),
3991 )
3992 .unwrap()
3993 }
3994 }
3995 #[inline]
3996 pub fn delegate_request(&self) -> flatbuffers::Table<'a> {
3997 unsafe {
4001 self._tab
4002 .get::<flatbuffers::ForwardsUOffset<flatbuffers::Table<'a>>>(
4003 DelegateRequest::VT_DELEGATE_REQUEST,
4004 None,
4005 )
4006 .unwrap()
4007 }
4008 }
4009 #[inline]
4010 #[allow(non_snake_case)]
4011 pub fn delegate_request_as_application_messages(&self) -> Option<ApplicationMessages<'a>> {
4012 if self.delegate_request_type() == DelegateRequestType::ApplicationMessages {
4013 let u = self.delegate_request();
4014 Some(unsafe { ApplicationMessages::init_from_table(u) })
4018 } else {
4019 None
4020 }
4021 }
4022
4023 #[inline]
4024 #[allow(non_snake_case)]
4025 pub fn delegate_request_as_get_secret_request_type(
4026 &self,
4027 ) -> Option<GetSecretRequestType<'a>> {
4028 if self.delegate_request_type() == DelegateRequestType::GetSecretRequestType {
4029 let u = self.delegate_request();
4030 Some(unsafe { GetSecretRequestType::init_from_table(u) })
4034 } else {
4035 None
4036 }
4037 }
4038
4039 #[inline]
4040 #[allow(non_snake_case)]
4041 pub fn delegate_request_as_register_delegate(&self) -> Option<RegisterDelegate<'a>> {
4042 if self.delegate_request_type() == DelegateRequestType::RegisterDelegate {
4043 let u = self.delegate_request();
4044 Some(unsafe { RegisterDelegate::init_from_table(u) })
4048 } else {
4049 None
4050 }
4051 }
4052
4053 #[inline]
4054 #[allow(non_snake_case)]
4055 pub fn delegate_request_as_unregister_delegate(&self) -> Option<UnregisterDelegate<'a>> {
4056 if self.delegate_request_type() == DelegateRequestType::UnregisterDelegate {
4057 let u = self.delegate_request();
4058 Some(unsafe { UnregisterDelegate::init_from_table(u) })
4062 } else {
4063 None
4064 }
4065 }
4066 }
4067
4068 impl flatbuffers::Verifiable for DelegateRequest<'_> {
4069 #[inline]
4070 fn run_verifier(
4071 v: &mut flatbuffers::Verifier,
4072 pos: usize,
4073 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
4074 use self::flatbuffers::Verifiable;
4075 v.visit_table(pos)?
4076 .visit_union::<DelegateRequestType, _>("delegate_request_type", Self::VT_DELEGATE_REQUEST_TYPE, "delegate_request", Self::VT_DELEGATE_REQUEST, true, |key, v, pos| {
4077 match key {
4078 DelegateRequestType::ApplicationMessages => v.verify_union_variant::<flatbuffers::ForwardsUOffset<ApplicationMessages>>("DelegateRequestType::ApplicationMessages", pos),
4079 DelegateRequestType::GetSecretRequestType => v.verify_union_variant::<flatbuffers::ForwardsUOffset<GetSecretRequestType>>("DelegateRequestType::GetSecretRequestType", pos),
4080 DelegateRequestType::RegisterDelegate => v.verify_union_variant::<flatbuffers::ForwardsUOffset<RegisterDelegate>>("DelegateRequestType::RegisterDelegate", pos),
4081 DelegateRequestType::UnregisterDelegate => v.verify_union_variant::<flatbuffers::ForwardsUOffset<UnregisterDelegate>>("DelegateRequestType::UnregisterDelegate", pos),
4082 _ => Ok(()),
4083 }
4084 })?
4085 .finish();
4086 Ok(())
4087 }
4088 }
4089 pub struct DelegateRequestArgs {
4090 pub delegate_request_type: DelegateRequestType,
4091 pub delegate_request: Option<flatbuffers::WIPOffset<flatbuffers::UnionWIPOffset>>,
4092 }
4093 impl<'a> Default for DelegateRequestArgs {
4094 #[inline]
4095 fn default() -> Self {
4096 DelegateRequestArgs {
4097 delegate_request_type: DelegateRequestType::NONE,
4098 delegate_request: None, }
4100 }
4101 }
4102
4103 pub struct DelegateRequestBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
4104 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
4105 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
4106 }
4107 impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> DelegateRequestBuilder<'a, 'b, A> {
4108 #[inline]
4109 pub fn add_delegate_request_type(&mut self, delegate_request_type: DelegateRequestType) {
4110 self.fbb_.push_slot::<DelegateRequestType>(
4111 DelegateRequest::VT_DELEGATE_REQUEST_TYPE,
4112 delegate_request_type,
4113 DelegateRequestType::NONE,
4114 );
4115 }
4116 #[inline]
4117 pub fn add_delegate_request(
4118 &mut self,
4119 delegate_request: flatbuffers::WIPOffset<flatbuffers::UnionWIPOffset>,
4120 ) {
4121 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(
4122 DelegateRequest::VT_DELEGATE_REQUEST,
4123 delegate_request,
4124 );
4125 }
4126 #[inline]
4127 pub fn new(
4128 _fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
4129 ) -> DelegateRequestBuilder<'a, 'b, A> {
4130 let start = _fbb.start_table();
4131 DelegateRequestBuilder {
4132 fbb_: _fbb,
4133 start_: start,
4134 }
4135 }
4136 #[inline]
4137 pub fn finish(self) -> flatbuffers::WIPOffset<DelegateRequest<'a>> {
4138 let o = self.fbb_.end_table(self.start_);
4139 self.fbb_
4140 .required(o, DelegateRequest::VT_DELEGATE_REQUEST, "delegate_request");
4141 flatbuffers::WIPOffset::new(o.value())
4142 }
4143 }
4144
4145 impl core::fmt::Debug for DelegateRequest<'_> {
4146 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
4147 let mut ds = f.debug_struct("DelegateRequest");
4148 ds.field("delegate_request_type", &self.delegate_request_type());
4149 match self.delegate_request_type() {
4150 DelegateRequestType::ApplicationMessages => {
4151 if let Some(x) = self.delegate_request_as_application_messages() {
4152 ds.field("delegate_request", &x)
4153 } else {
4154 ds.field(
4155 "delegate_request",
4156 &"InvalidFlatbuffer: Union discriminant does not match value.",
4157 )
4158 }
4159 }
4160 DelegateRequestType::GetSecretRequestType => {
4161 if let Some(x) = self.delegate_request_as_get_secret_request_type() {
4162 ds.field("delegate_request", &x)
4163 } else {
4164 ds.field(
4165 "delegate_request",
4166 &"InvalidFlatbuffer: Union discriminant does not match value.",
4167 )
4168 }
4169 }
4170 DelegateRequestType::RegisterDelegate => {
4171 if let Some(x) = self.delegate_request_as_register_delegate() {
4172 ds.field("delegate_request", &x)
4173 } else {
4174 ds.field(
4175 "delegate_request",
4176 &"InvalidFlatbuffer: Union discriminant does not match value.",
4177 )
4178 }
4179 }
4180 DelegateRequestType::UnregisterDelegate => {
4181 if let Some(x) = self.delegate_request_as_unregister_delegate() {
4182 ds.field("delegate_request", &x)
4183 } else {
4184 ds.field(
4185 "delegate_request",
4186 &"InvalidFlatbuffer: Union discriminant does not match value.",
4187 )
4188 }
4189 }
4190 _ => {
4191 let x: Option<()> = None;
4192 ds.field("delegate_request", &x)
4193 }
4194 };
4195 ds.finish()
4196 }
4197 }
4198 pub enum DisconnectOffset {}
4199 #[derive(Copy, Clone, PartialEq)]
4200
4201 pub struct Disconnect<'a> {
4202 pub _tab: flatbuffers::Table<'a>,
4203 }
4204
4205 impl<'a> flatbuffers::Follow<'a> for Disconnect<'a> {
4206 type Inner = Disconnect<'a>;
4207 #[inline]
4208 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
4209 Self {
4210 _tab: flatbuffers::Table::new(buf, loc),
4211 }
4212 }
4213 }
4214
4215 impl<'a> Disconnect<'a> {
4216 pub const VT_CAUSE: flatbuffers::VOffsetT = 4;
4217
4218 #[inline]
4219 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
4220 Disconnect { _tab: table }
4221 }
4222 #[allow(unused_mut)]
4223 pub fn create<
4224 'bldr: 'args,
4225 'args: 'mut_bldr,
4226 'mut_bldr,
4227 A: flatbuffers::Allocator + 'bldr,
4228 >(
4229 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
4230 args: &'args DisconnectArgs<'args>,
4231 ) -> flatbuffers::WIPOffset<Disconnect<'bldr>> {
4232 let mut builder = DisconnectBuilder::new(_fbb);
4233 if let Some(x) = args.cause {
4234 builder.add_cause(x);
4235 }
4236 builder.finish()
4237 }
4238
4239 #[inline]
4240 pub fn cause(&self) -> Option<&'a str> {
4241 unsafe {
4245 self._tab
4246 .get::<flatbuffers::ForwardsUOffset<&str>>(Disconnect::VT_CAUSE, None)
4247 }
4248 }
4249 }
4250
4251 impl flatbuffers::Verifiable for Disconnect<'_> {
4252 #[inline]
4253 fn run_verifier(
4254 v: &mut flatbuffers::Verifier,
4255 pos: usize,
4256 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
4257 use self::flatbuffers::Verifiable;
4258 v.visit_table(pos)?
4259 .visit_field::<flatbuffers::ForwardsUOffset<&str>>("cause", Self::VT_CAUSE, false)?
4260 .finish();
4261 Ok(())
4262 }
4263 }
4264 pub struct DisconnectArgs<'a> {
4265 pub cause: Option<flatbuffers::WIPOffset<&'a str>>,
4266 }
4267 impl<'a> Default for DisconnectArgs<'a> {
4268 #[inline]
4269 fn default() -> Self {
4270 DisconnectArgs { cause: None }
4271 }
4272 }
4273
4274 pub struct DisconnectBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
4275 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
4276 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
4277 }
4278 impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> DisconnectBuilder<'a, 'b, A> {
4279 #[inline]
4280 pub fn add_cause(&mut self, cause: flatbuffers::WIPOffset<&'b str>) {
4281 self.fbb_
4282 .push_slot_always::<flatbuffers::WIPOffset<_>>(Disconnect::VT_CAUSE, cause);
4283 }
4284 #[inline]
4285 pub fn new(
4286 _fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
4287 ) -> DisconnectBuilder<'a, 'b, A> {
4288 let start = _fbb.start_table();
4289 DisconnectBuilder {
4290 fbb_: _fbb,
4291 start_: start,
4292 }
4293 }
4294 #[inline]
4295 pub fn finish(self) -> flatbuffers::WIPOffset<Disconnect<'a>> {
4296 let o = self.fbb_.end_table(self.start_);
4297 flatbuffers::WIPOffset::new(o.value())
4298 }
4299 }
4300
4301 impl core::fmt::Debug for Disconnect<'_> {
4302 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
4303 let mut ds = f.debug_struct("Disconnect");
4304 ds.field("cause", &self.cause());
4305 ds.finish()
4306 }
4307 }
4308 pub enum AuthenticateOffset {}
4309 #[derive(Copy, Clone, PartialEq)]
4310
4311 pub struct Authenticate<'a> {
4312 pub _tab: flatbuffers::Table<'a>,
4313 }
4314
4315 impl<'a> flatbuffers::Follow<'a> for Authenticate<'a> {
4316 type Inner = Authenticate<'a>;
4317 #[inline]
4318 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
4319 Self {
4320 _tab: flatbuffers::Table::new(buf, loc),
4321 }
4322 }
4323 }
4324
4325 impl<'a> Authenticate<'a> {
4326 pub const VT_TOKEN: flatbuffers::VOffsetT = 4;
4327
4328 #[inline]
4329 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
4330 Authenticate { _tab: table }
4331 }
4332 #[allow(unused_mut)]
4333 pub fn create<
4334 'bldr: 'args,
4335 'args: 'mut_bldr,
4336 'mut_bldr,
4337 A: flatbuffers::Allocator + 'bldr,
4338 >(
4339 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
4340 args: &'args AuthenticateArgs<'args>,
4341 ) -> flatbuffers::WIPOffset<Authenticate<'bldr>> {
4342 let mut builder = AuthenticateBuilder::new(_fbb);
4343 if let Some(x) = args.token {
4344 builder.add_token(x);
4345 }
4346 builder.finish()
4347 }
4348
4349 #[inline]
4350 pub fn token(&self) -> &'a str {
4351 unsafe {
4355 self._tab
4356 .get::<flatbuffers::ForwardsUOffset<&str>>(Authenticate::VT_TOKEN, None)
4357 .unwrap()
4358 }
4359 }
4360 }
4361
4362 impl flatbuffers::Verifiable for Authenticate<'_> {
4363 #[inline]
4364 fn run_verifier(
4365 v: &mut flatbuffers::Verifier,
4366 pos: usize,
4367 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
4368 use self::flatbuffers::Verifiable;
4369 v.visit_table(pos)?
4370 .visit_field::<flatbuffers::ForwardsUOffset<&str>>("token", Self::VT_TOKEN, true)?
4371 .finish();
4372 Ok(())
4373 }
4374 }
4375 pub struct AuthenticateArgs<'a> {
4376 pub token: Option<flatbuffers::WIPOffset<&'a str>>,
4377 }
4378 impl<'a> Default for AuthenticateArgs<'a> {
4379 #[inline]
4380 fn default() -> Self {
4381 AuthenticateArgs {
4382 token: None, }
4384 }
4385 }
4386
4387 pub struct AuthenticateBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
4388 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
4389 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
4390 }
4391 impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> AuthenticateBuilder<'a, 'b, A> {
4392 #[inline]
4393 pub fn add_token(&mut self, token: flatbuffers::WIPOffset<&'b str>) {
4394 self.fbb_
4395 .push_slot_always::<flatbuffers::WIPOffset<_>>(Authenticate::VT_TOKEN, token);
4396 }
4397 #[inline]
4398 pub fn new(
4399 _fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
4400 ) -> AuthenticateBuilder<'a, 'b, A> {
4401 let start = _fbb.start_table();
4402 AuthenticateBuilder {
4403 fbb_: _fbb,
4404 start_: start,
4405 }
4406 }
4407 #[inline]
4408 pub fn finish(self) -> flatbuffers::WIPOffset<Authenticate<'a>> {
4409 let o = self.fbb_.end_table(self.start_);
4410 self.fbb_.required(o, Authenticate::VT_TOKEN, "token");
4411 flatbuffers::WIPOffset::new(o.value())
4412 }
4413 }
4414
4415 impl core::fmt::Debug for Authenticate<'_> {
4416 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
4417 let mut ds = f.debug_struct("Authenticate");
4418 ds.field("token", &self.token());
4419 ds.finish()
4420 }
4421 }
4422 pub enum ClientRequestOffset {}
4423 #[derive(Copy, Clone, PartialEq)]
4424
4425 pub struct ClientRequest<'a> {
4426 pub _tab: flatbuffers::Table<'a>,
4427 }
4428
4429 impl<'a> flatbuffers::Follow<'a> for ClientRequest<'a> {
4430 type Inner = ClientRequest<'a>;
4431 #[inline]
4432 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
4433 Self {
4434 _tab: flatbuffers::Table::new(buf, loc),
4435 }
4436 }
4437 }
4438
4439 impl<'a> ClientRequest<'a> {
4440 pub const VT_CLIENT_REQUEST_TYPE: flatbuffers::VOffsetT = 4;
4441 pub const VT_CLIENT_REQUEST: flatbuffers::VOffsetT = 6;
4442
4443 #[inline]
4444 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
4445 ClientRequest { _tab: table }
4446 }
4447 #[allow(unused_mut)]
4448 pub fn create<
4449 'bldr: 'args,
4450 'args: 'mut_bldr,
4451 'mut_bldr,
4452 A: flatbuffers::Allocator + 'bldr,
4453 >(
4454 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
4455 args: &'args ClientRequestArgs,
4456 ) -> flatbuffers::WIPOffset<ClientRequest<'bldr>> {
4457 let mut builder = ClientRequestBuilder::new(_fbb);
4458 if let Some(x) = args.client_request {
4459 builder.add_client_request(x);
4460 }
4461 builder.add_client_request_type(args.client_request_type);
4462 builder.finish()
4463 }
4464
4465 #[inline]
4466 pub fn client_request_type(&self) -> ClientRequestType {
4467 unsafe {
4471 self._tab
4472 .get::<ClientRequestType>(
4473 ClientRequest::VT_CLIENT_REQUEST_TYPE,
4474 Some(ClientRequestType::NONE),
4475 )
4476 .unwrap()
4477 }
4478 }
4479 #[inline]
4480 pub fn client_request(&self) -> flatbuffers::Table<'a> {
4481 unsafe {
4485 self._tab
4486 .get::<flatbuffers::ForwardsUOffset<flatbuffers::Table<'a>>>(
4487 ClientRequest::VT_CLIENT_REQUEST,
4488 None,
4489 )
4490 .unwrap()
4491 }
4492 }
4493 #[inline]
4494 #[allow(non_snake_case)]
4495 pub fn client_request_as_contract_request(&self) -> Option<ContractRequest<'a>> {
4496 if self.client_request_type() == ClientRequestType::ContractRequest {
4497 let u = self.client_request();
4498 Some(unsafe { ContractRequest::init_from_table(u) })
4502 } else {
4503 None
4504 }
4505 }
4506
4507 #[inline]
4508 #[allow(non_snake_case)]
4509 pub fn client_request_as_delegate_request(&self) -> Option<DelegateRequest<'a>> {
4510 if self.client_request_type() == ClientRequestType::DelegateRequest {
4511 let u = self.client_request();
4512 Some(unsafe { DelegateRequest::init_from_table(u) })
4516 } else {
4517 None
4518 }
4519 }
4520
4521 #[inline]
4522 #[allow(non_snake_case)]
4523 pub fn client_request_as_disconnect(&self) -> Option<Disconnect<'a>> {
4524 if self.client_request_type() == ClientRequestType::Disconnect {
4525 let u = self.client_request();
4526 Some(unsafe { Disconnect::init_from_table(u) })
4530 } else {
4531 None
4532 }
4533 }
4534
4535 #[inline]
4536 #[allow(non_snake_case)]
4537 pub fn client_request_as_authenticate(&self) -> Option<Authenticate<'a>> {
4538 if self.client_request_type() == ClientRequestType::Authenticate {
4539 let u = self.client_request();
4540 Some(unsafe { Authenticate::init_from_table(u) })
4544 } else {
4545 None
4546 }
4547 }
4548 }
4549
4550 impl flatbuffers::Verifiable for ClientRequest<'_> {
4551 #[inline]
4552 fn run_verifier(
4553 v: &mut flatbuffers::Verifier,
4554 pos: usize,
4555 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
4556 use self::flatbuffers::Verifiable;
4557 v.visit_table(pos)?
4558 .visit_union::<ClientRequestType, _>(
4559 "client_request_type",
4560 Self::VT_CLIENT_REQUEST_TYPE,
4561 "client_request",
4562 Self::VT_CLIENT_REQUEST,
4563 true,
4564 |key, v, pos| match key {
4565 ClientRequestType::ContractRequest => v
4566 .verify_union_variant::<flatbuffers::ForwardsUOffset<ContractRequest>>(
4567 "ClientRequestType::ContractRequest",
4568 pos,
4569 ),
4570 ClientRequestType::DelegateRequest => v
4571 .verify_union_variant::<flatbuffers::ForwardsUOffset<DelegateRequest>>(
4572 "ClientRequestType::DelegateRequest",
4573 pos,
4574 ),
4575 ClientRequestType::Disconnect => v
4576 .verify_union_variant::<flatbuffers::ForwardsUOffset<Disconnect>>(
4577 "ClientRequestType::Disconnect",
4578 pos,
4579 ),
4580 ClientRequestType::Authenticate => v
4581 .verify_union_variant::<flatbuffers::ForwardsUOffset<Authenticate>>(
4582 "ClientRequestType::Authenticate",
4583 pos,
4584 ),
4585 _ => Ok(()),
4586 },
4587 )?
4588 .finish();
4589 Ok(())
4590 }
4591 }
4592 pub struct ClientRequestArgs {
4593 pub client_request_type: ClientRequestType,
4594 pub client_request: Option<flatbuffers::WIPOffset<flatbuffers::UnionWIPOffset>>,
4595 }
4596 impl<'a> Default for ClientRequestArgs {
4597 #[inline]
4598 fn default() -> Self {
4599 ClientRequestArgs {
4600 client_request_type: ClientRequestType::NONE,
4601 client_request: None, }
4603 }
4604 }
4605
4606 pub struct ClientRequestBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
4607 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
4608 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
4609 }
4610 impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> ClientRequestBuilder<'a, 'b, A> {
4611 #[inline]
4612 pub fn add_client_request_type(&mut self, client_request_type: ClientRequestType) {
4613 self.fbb_.push_slot::<ClientRequestType>(
4614 ClientRequest::VT_CLIENT_REQUEST_TYPE,
4615 client_request_type,
4616 ClientRequestType::NONE,
4617 );
4618 }
4619 #[inline]
4620 pub fn add_client_request(
4621 &mut self,
4622 client_request: flatbuffers::WIPOffset<flatbuffers::UnionWIPOffset>,
4623 ) {
4624 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(
4625 ClientRequest::VT_CLIENT_REQUEST,
4626 client_request,
4627 );
4628 }
4629 #[inline]
4630 pub fn new(
4631 _fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
4632 ) -> ClientRequestBuilder<'a, 'b, A> {
4633 let start = _fbb.start_table();
4634 ClientRequestBuilder {
4635 fbb_: _fbb,
4636 start_: start,
4637 }
4638 }
4639 #[inline]
4640 pub fn finish(self) -> flatbuffers::WIPOffset<ClientRequest<'a>> {
4641 let o = self.fbb_.end_table(self.start_);
4642 self.fbb_
4643 .required(o, ClientRequest::VT_CLIENT_REQUEST, "client_request");
4644 flatbuffers::WIPOffset::new(o.value())
4645 }
4646 }
4647
4648 impl core::fmt::Debug for ClientRequest<'_> {
4649 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
4650 let mut ds = f.debug_struct("ClientRequest");
4651 ds.field("client_request_type", &self.client_request_type());
4652 match self.client_request_type() {
4653 ClientRequestType::ContractRequest => {
4654 if let Some(x) = self.client_request_as_contract_request() {
4655 ds.field("client_request", &x)
4656 } else {
4657 ds.field(
4658 "client_request",
4659 &"InvalidFlatbuffer: Union discriminant does not match value.",
4660 )
4661 }
4662 }
4663 ClientRequestType::DelegateRequest => {
4664 if let Some(x) = self.client_request_as_delegate_request() {
4665 ds.field("client_request", &x)
4666 } else {
4667 ds.field(
4668 "client_request",
4669 &"InvalidFlatbuffer: Union discriminant does not match value.",
4670 )
4671 }
4672 }
4673 ClientRequestType::Disconnect => {
4674 if let Some(x) = self.client_request_as_disconnect() {
4675 ds.field("client_request", &x)
4676 } else {
4677 ds.field(
4678 "client_request",
4679 &"InvalidFlatbuffer: Union discriminant does not match value.",
4680 )
4681 }
4682 }
4683 ClientRequestType::Authenticate => {
4684 if let Some(x) = self.client_request_as_authenticate() {
4685 ds.field("client_request", &x)
4686 } else {
4687 ds.field(
4688 "client_request",
4689 &"InvalidFlatbuffer: Union discriminant does not match value.",
4690 )
4691 }
4692 }
4693 _ => {
4694 let x: Option<()> = None;
4695 ds.field("client_request", &x)
4696 }
4697 };
4698 ds.finish()
4699 }
4700 }
4701 #[inline]
4702 pub fn root_as_client_request(
4709 buf: &[u8],
4710 ) -> Result<ClientRequest, flatbuffers::InvalidFlatbuffer> {
4711 flatbuffers::root::<ClientRequest>(buf)
4712 }
4713 #[inline]
4714 pub fn size_prefixed_root_as_client_request(
4721 buf: &[u8],
4722 ) -> Result<ClientRequest, flatbuffers::InvalidFlatbuffer> {
4723 flatbuffers::size_prefixed_root::<ClientRequest>(buf)
4724 }
4725 #[inline]
4726 pub fn root_as_client_request_with_opts<'b, 'o>(
4733 opts: &'o flatbuffers::VerifierOptions,
4734 buf: &'b [u8],
4735 ) -> Result<ClientRequest<'b>, flatbuffers::InvalidFlatbuffer> {
4736 flatbuffers::root_with_opts::<ClientRequest<'b>>(opts, buf)
4737 }
4738 #[inline]
4739 pub fn size_prefixed_root_as_client_request_with_opts<'b, 'o>(
4746 opts: &'o flatbuffers::VerifierOptions,
4747 buf: &'b [u8],
4748 ) -> Result<ClientRequest<'b>, flatbuffers::InvalidFlatbuffer> {
4749 flatbuffers::size_prefixed_root_with_opts::<ClientRequest<'b>>(opts, buf)
4750 }
4751 #[inline]
4752 pub unsafe fn root_as_client_request_unchecked(buf: &[u8]) -> ClientRequest {
4756 flatbuffers::root_unchecked::<ClientRequest>(buf)
4757 }
4758 #[inline]
4759 pub unsafe fn size_prefixed_root_as_client_request_unchecked(buf: &[u8]) -> ClientRequest {
4763 flatbuffers::size_prefixed_root_unchecked::<ClientRequest>(buf)
4764 }
4765 #[inline]
4766 pub fn finish_client_request_buffer<'a, 'b, A: flatbuffers::Allocator + 'a>(
4767 fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
4768 root: flatbuffers::WIPOffset<ClientRequest<'a>>,
4769 ) {
4770 fbb.finish(root, None);
4771 }
4772
4773 #[inline]
4774 pub fn finish_size_prefixed_client_request_buffer<'a, 'b, A: flatbuffers::Allocator + 'a>(
4775 fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
4776 root: flatbuffers::WIPOffset<ClientRequest<'a>>,
4777 ) {
4778 fbb.finish_size_prefixed(root, None);
4779 }
4780}