freenet_stdlib/generated/
host_response_generated.rs

1// automatically generated by the FlatBuffers compiler, do not modify
2
3// @generated
4
5use 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 host_response {
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_CONTRACT_RESPONSE_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_CONTRACT_RESPONSE_TYPE: u8 = 4;
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_CONTRACT_RESPONSE_TYPE: [ContractResponseType; 5] = [
38        ContractResponseType::NONE,
39        ContractResponseType::GetResponse,
40        ContractResponseType::PutResponse,
41        ContractResponseType::UpdateNotification,
42        ContractResponseType::UpdateResponse,
43    ];
44
45    #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
46    #[repr(transparent)]
47    pub struct ContractResponseType(pub u8);
48    #[allow(non_upper_case_globals)]
49    impl ContractResponseType {
50        pub const NONE: Self = Self(0);
51        pub const GetResponse: Self = Self(1);
52        pub const PutResponse: Self = Self(2);
53        pub const UpdateNotification: Self = Self(3);
54        pub const UpdateResponse: Self = Self(4);
55
56        pub const ENUM_MIN: u8 = 0;
57        pub const ENUM_MAX: u8 = 4;
58        pub const ENUM_VALUES: &'static [Self] = &[
59            Self::NONE,
60            Self::GetResponse,
61            Self::PutResponse,
62            Self::UpdateNotification,
63            Self::UpdateResponse,
64        ];
65        /// Returns the variant's name or "" if unknown.
66        pub fn variant_name(self) -> Option<&'static str> {
67            match self {
68                Self::NONE => Some("NONE"),
69                Self::GetResponse => Some("GetResponse"),
70                Self::PutResponse => Some("PutResponse"),
71                Self::UpdateNotification => Some("UpdateNotification"),
72                Self::UpdateResponse => Some("UpdateResponse"),
73                _ => None,
74            }
75        }
76    }
77    impl core::fmt::Debug for ContractResponseType {
78        fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
79            if let Some(name) = self.variant_name() {
80                f.write_str(name)
81            } else {
82                f.write_fmt(format_args!("<UNKNOWN {:?}>", self.0))
83            }
84        }
85    }
86    impl<'a> flatbuffers::Follow<'a> for ContractResponseType {
87        type Inner = Self;
88        #[inline]
89        unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
90            let b = flatbuffers::read_scalar_at::<u8>(buf, loc);
91            Self(b)
92        }
93    }
94
95    impl flatbuffers::Push for ContractResponseType {
96        type Output = ContractResponseType;
97        #[inline]
98        unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
99            flatbuffers::emplace_scalar::<u8>(dst, self.0);
100        }
101    }
102
103    impl flatbuffers::EndianScalar for ContractResponseType {
104        type Scalar = u8;
105        #[inline]
106        fn to_little_endian(self) -> u8 {
107            self.0.to_le()
108        }
109        #[inline]
110        #[allow(clippy::wrong_self_convention)]
111        fn from_little_endian(v: u8) -> Self {
112            let b = u8::from_le(v);
113            Self(b)
114        }
115    }
116
117    impl<'a> flatbuffers::Verifiable for ContractResponseType {
118        #[inline]
119        fn run_verifier(
120            v: &mut flatbuffers::Verifier,
121            pos: usize,
122        ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
123            use self::flatbuffers::Verifiable;
124            u8::run_verifier(v, pos)
125        }
126    }
127
128    impl flatbuffers::SimpleToVerifyInSlice for ContractResponseType {}
129    pub struct ContractResponseTypeUnionTableOffset {}
130
131    #[deprecated(
132        since = "2.0.0",
133        note = "Use associated constants instead. This will no longer be generated in 2021."
134    )]
135    pub const ENUM_MIN_OUTBOUND_DELEGATE_MSG_TYPE: u8 = 0;
136    #[deprecated(
137        since = "2.0.0",
138        note = "Use associated constants instead. This will no longer be generated in 2021."
139    )]
140    pub const ENUM_MAX_OUTBOUND_DELEGATE_MSG_TYPE: u8 = 6;
141    #[deprecated(
142        since = "2.0.0",
143        note = "Use associated constants instead. This will no longer be generated in 2021."
144    )]
145    #[allow(non_camel_case_types)]
146    pub const ENUM_VALUES_OUTBOUND_DELEGATE_MSG_TYPE: [OutboundDelegateMsgType; 7] = [
147        OutboundDelegateMsgType::NONE,
148        OutboundDelegateMsgType::common_ApplicationMessage,
149        OutboundDelegateMsgType::RequestUserInput,
150        OutboundDelegateMsgType::ContextUpdated,
151        OutboundDelegateMsgType::common_GetSecretRequest,
152        OutboundDelegateMsgType::SetSecretRequest,
153        OutboundDelegateMsgType::common_GetSecretResponse,
154    ];
155
156    #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
157    #[repr(transparent)]
158    pub struct OutboundDelegateMsgType(pub u8);
159    #[allow(non_upper_case_globals)]
160    impl OutboundDelegateMsgType {
161        pub const NONE: Self = Self(0);
162        pub const common_ApplicationMessage: Self = Self(1);
163        pub const RequestUserInput: Self = Self(2);
164        pub const ContextUpdated: Self = Self(3);
165        pub const common_GetSecretRequest: Self = Self(4);
166        pub const SetSecretRequest: Self = Self(5);
167        pub const common_GetSecretResponse: Self = Self(6);
168
169        pub const ENUM_MIN: u8 = 0;
170        pub const ENUM_MAX: u8 = 6;
171        pub const ENUM_VALUES: &'static [Self] = &[
172            Self::NONE,
173            Self::common_ApplicationMessage,
174            Self::RequestUserInput,
175            Self::ContextUpdated,
176            Self::common_GetSecretRequest,
177            Self::SetSecretRequest,
178            Self::common_GetSecretResponse,
179        ];
180        /// Returns the variant's name or "" if unknown.
181        pub fn variant_name(self) -> Option<&'static str> {
182            match self {
183                Self::NONE => Some("NONE"),
184                Self::common_ApplicationMessage => Some("common_ApplicationMessage"),
185                Self::RequestUserInput => Some("RequestUserInput"),
186                Self::ContextUpdated => Some("ContextUpdated"),
187                Self::common_GetSecretRequest => Some("common_GetSecretRequest"),
188                Self::SetSecretRequest => Some("SetSecretRequest"),
189                Self::common_GetSecretResponse => Some("common_GetSecretResponse"),
190                _ => None,
191            }
192        }
193    }
194    impl core::fmt::Debug for OutboundDelegateMsgType {
195        fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
196            if let Some(name) = self.variant_name() {
197                f.write_str(name)
198            } else {
199                f.write_fmt(format_args!("<UNKNOWN {:?}>", self.0))
200            }
201        }
202    }
203    impl<'a> flatbuffers::Follow<'a> for OutboundDelegateMsgType {
204        type Inner = Self;
205        #[inline]
206        unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
207            let b = flatbuffers::read_scalar_at::<u8>(buf, loc);
208            Self(b)
209        }
210    }
211
212    impl flatbuffers::Push for OutboundDelegateMsgType {
213        type Output = OutboundDelegateMsgType;
214        #[inline]
215        unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
216            flatbuffers::emplace_scalar::<u8>(dst, self.0);
217        }
218    }
219
220    impl flatbuffers::EndianScalar for OutboundDelegateMsgType {
221        type Scalar = u8;
222        #[inline]
223        fn to_little_endian(self) -> u8 {
224            self.0.to_le()
225        }
226        #[inline]
227        #[allow(clippy::wrong_self_convention)]
228        fn from_little_endian(v: u8) -> Self {
229            let b = u8::from_le(v);
230            Self(b)
231        }
232    }
233
234    impl<'a> flatbuffers::Verifiable for OutboundDelegateMsgType {
235        #[inline]
236        fn run_verifier(
237            v: &mut flatbuffers::Verifier,
238            pos: usize,
239        ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
240            use self::flatbuffers::Verifiable;
241            u8::run_verifier(v, pos)
242        }
243    }
244
245    impl flatbuffers::SimpleToVerifyInSlice for OutboundDelegateMsgType {}
246    pub struct OutboundDelegateMsgTypeUnionTableOffset {}
247
248    #[deprecated(
249        since = "2.0.0",
250        note = "Use associated constants instead. This will no longer be generated in 2021."
251    )]
252    pub const ENUM_MIN_HOST_RESPONSE_TYPE: u8 = 0;
253    #[deprecated(
254        since = "2.0.0",
255        note = "Use associated constants instead. This will no longer be generated in 2021."
256    )]
257    pub const ENUM_MAX_HOST_RESPONSE_TYPE: u8 = 5;
258    #[deprecated(
259        since = "2.0.0",
260        note = "Use associated constants instead. This will no longer be generated in 2021."
261    )]
262    #[allow(non_camel_case_types)]
263    pub const ENUM_VALUES_HOST_RESPONSE_TYPE: [HostResponseType; 6] = [
264        HostResponseType::NONE,
265        HostResponseType::ContractResponse,
266        HostResponseType::DelegateResponse,
267        HostResponseType::GenerateRandData,
268        HostResponseType::Ok,
269        HostResponseType::Error,
270    ];
271
272    #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
273    #[repr(transparent)]
274    pub struct HostResponseType(pub u8);
275    #[allow(non_upper_case_globals)]
276    impl HostResponseType {
277        pub const NONE: Self = Self(0);
278        pub const ContractResponse: Self = Self(1);
279        pub const DelegateResponse: Self = Self(2);
280        pub const GenerateRandData: Self = Self(3);
281        pub const Ok: Self = Self(4);
282        pub const Error: Self = Self(5);
283
284        pub const ENUM_MIN: u8 = 0;
285        pub const ENUM_MAX: u8 = 5;
286        pub const ENUM_VALUES: &'static [Self] = &[
287            Self::NONE,
288            Self::ContractResponse,
289            Self::DelegateResponse,
290            Self::GenerateRandData,
291            Self::Ok,
292            Self::Error,
293        ];
294        /// Returns the variant's name or "" if unknown.
295        pub fn variant_name(self) -> Option<&'static str> {
296            match self {
297                Self::NONE => Some("NONE"),
298                Self::ContractResponse => Some("ContractResponse"),
299                Self::DelegateResponse => Some("DelegateResponse"),
300                Self::GenerateRandData => Some("GenerateRandData"),
301                Self::Ok => Some("Ok"),
302                Self::Error => Some("Error"),
303                _ => None,
304            }
305        }
306    }
307    impl core::fmt::Debug for HostResponseType {
308        fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
309            if let Some(name) = self.variant_name() {
310                f.write_str(name)
311            } else {
312                f.write_fmt(format_args!("<UNKNOWN {:?}>", self.0))
313            }
314        }
315    }
316    impl<'a> flatbuffers::Follow<'a> for HostResponseType {
317        type Inner = Self;
318        #[inline]
319        unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
320            let b = flatbuffers::read_scalar_at::<u8>(buf, loc);
321            Self(b)
322        }
323    }
324
325    impl flatbuffers::Push for HostResponseType {
326        type Output = HostResponseType;
327        #[inline]
328        unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
329            flatbuffers::emplace_scalar::<u8>(dst, self.0);
330        }
331    }
332
333    impl flatbuffers::EndianScalar for HostResponseType {
334        type Scalar = u8;
335        #[inline]
336        fn to_little_endian(self) -> u8 {
337            self.0.to_le()
338        }
339        #[inline]
340        #[allow(clippy::wrong_self_convention)]
341        fn from_little_endian(v: u8) -> Self {
342            let b = u8::from_le(v);
343            Self(b)
344        }
345    }
346
347    impl<'a> flatbuffers::Verifiable for HostResponseType {
348        #[inline]
349        fn run_verifier(
350            v: &mut flatbuffers::Verifier,
351            pos: usize,
352        ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
353            use self::flatbuffers::Verifiable;
354            u8::run_verifier(v, pos)
355        }
356    }
357
358    impl flatbuffers::SimpleToVerifyInSlice for HostResponseType {}
359    pub struct HostResponseTypeUnionTableOffset {}
360
361    pub enum GetResponseOffset {}
362    #[derive(Copy, Clone, PartialEq)]
363
364    pub struct GetResponse<'a> {
365        pub _tab: flatbuffers::Table<'a>,
366    }
367
368    impl<'a> flatbuffers::Follow<'a> for GetResponse<'a> {
369        type Inner = GetResponse<'a>;
370        #[inline]
371        unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
372            Self {
373                _tab: flatbuffers::Table::new(buf, loc),
374            }
375        }
376    }
377
378    impl<'a> GetResponse<'a> {
379        pub const VT_KEY: flatbuffers::VOffsetT = 4;
380        pub const VT_CONTRACT: flatbuffers::VOffsetT = 6;
381        pub const VT_STATE: flatbuffers::VOffsetT = 8;
382
383        #[inline]
384        pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
385            GetResponse { _tab: table }
386        }
387        #[allow(unused_mut)]
388        pub fn create<
389            'bldr: 'args,
390            'args: 'mut_bldr,
391            'mut_bldr,
392            A: flatbuffers::Allocator + 'bldr,
393        >(
394            _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
395            args: &'args GetResponseArgs<'args>,
396        ) -> flatbuffers::WIPOffset<GetResponse<'bldr>> {
397            let mut builder = GetResponseBuilder::new(_fbb);
398            if let Some(x) = args.state {
399                builder.add_state(x);
400            }
401            if let Some(x) = args.contract {
402                builder.add_contract(x);
403            }
404            if let Some(x) = args.key {
405                builder.add_key(x);
406            }
407            builder.finish()
408        }
409
410        #[inline]
411        pub fn key(&self) -> super::common::ContractKey<'a> {
412            // Safety:
413            // Created from valid Table for this object
414            // which contains a valid value in this slot
415            unsafe {
416                self._tab
417                    .get::<flatbuffers::ForwardsUOffset<super::common::ContractKey>>(
418                        GetResponse::VT_KEY,
419                        None,
420                    )
421                    .unwrap()
422            }
423        }
424        #[inline]
425        pub fn contract(&self) -> Option<super::common::ContractContainer<'a>> {
426            // Safety:
427            // Created from valid Table for this object
428            // which contains a valid value in this slot
429            unsafe {
430                self._tab
431                    .get::<flatbuffers::ForwardsUOffset<super::common::ContractContainer>>(
432                        GetResponse::VT_CONTRACT,
433                        None,
434                    )
435            }
436        }
437        #[inline]
438        pub fn state(&self) -> flatbuffers::Vector<'a, u8> {
439            // Safety:
440            // Created from valid Table for this object
441            // which contains a valid value in this slot
442            unsafe {
443                self._tab
444                    .get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, u8>>>(
445                        GetResponse::VT_STATE,
446                        None,
447                    )
448                    .unwrap()
449            }
450        }
451    }
452
453    impl flatbuffers::Verifiable for GetResponse<'_> {
454        #[inline]
455        fn run_verifier(
456            v: &mut flatbuffers::Verifier,
457            pos: usize,
458        ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
459            use self::flatbuffers::Verifiable;
460            v.visit_table(pos)?
461                .visit_field::<flatbuffers::ForwardsUOffset<super::common::ContractKey>>(
462                    "key",
463                    Self::VT_KEY,
464                    true,
465                )?
466                .visit_field::<flatbuffers::ForwardsUOffset<super::common::ContractContainer>>(
467                    "contract",
468                    Self::VT_CONTRACT,
469                    false,
470                )?
471                .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, u8>>>(
472                    "state",
473                    Self::VT_STATE,
474                    true,
475                )?
476                .finish();
477            Ok(())
478        }
479    }
480    pub struct GetResponseArgs<'a> {
481        pub key: Option<flatbuffers::WIPOffset<super::common::ContractKey<'a>>>,
482        pub contract: Option<flatbuffers::WIPOffset<super::common::ContractContainer<'a>>>,
483        pub state: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, u8>>>,
484    }
485    impl<'a> Default for GetResponseArgs<'a> {
486        #[inline]
487        fn default() -> Self {
488            GetResponseArgs {
489                key: None, // required field
490                contract: None,
491                state: None, // required field
492            }
493        }
494    }
495
496    pub struct GetResponseBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
497        fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
498        start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
499    }
500    impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> GetResponseBuilder<'a, 'b, A> {
501        #[inline]
502        pub fn add_key(&mut self, key: flatbuffers::WIPOffset<super::common::ContractKey<'b>>) {
503            self.fbb_
504                .push_slot_always::<flatbuffers::WIPOffset<super::common::ContractKey>>(
505                    GetResponse::VT_KEY,
506                    key,
507                );
508        }
509        #[inline]
510        pub fn add_contract(
511            &mut self,
512            contract: flatbuffers::WIPOffset<super::common::ContractContainer<'b>>,
513        ) {
514            self.fbb_
515                .push_slot_always::<flatbuffers::WIPOffset<super::common::ContractContainer>>(
516                    GetResponse::VT_CONTRACT,
517                    contract,
518                );
519        }
520        #[inline]
521        pub fn add_state(&mut self, state: flatbuffers::WIPOffset<flatbuffers::Vector<'b, u8>>) {
522            self.fbb_
523                .push_slot_always::<flatbuffers::WIPOffset<_>>(GetResponse::VT_STATE, state);
524        }
525        #[inline]
526        pub fn new(
527            _fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
528        ) -> GetResponseBuilder<'a, 'b, A> {
529            let start = _fbb.start_table();
530            GetResponseBuilder {
531                fbb_: _fbb,
532                start_: start,
533            }
534        }
535        #[inline]
536        pub fn finish(self) -> flatbuffers::WIPOffset<GetResponse<'a>> {
537            let o = self.fbb_.end_table(self.start_);
538            self.fbb_.required(o, GetResponse::VT_KEY, "key");
539            self.fbb_.required(o, GetResponse::VT_STATE, "state");
540            flatbuffers::WIPOffset::new(o.value())
541        }
542    }
543
544    impl core::fmt::Debug for GetResponse<'_> {
545        fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
546            let mut ds = f.debug_struct("GetResponse");
547            ds.field("key", &self.key());
548            ds.field("contract", &self.contract());
549            ds.field("state", &self.state());
550            ds.finish()
551        }
552    }
553    pub enum PutResponseOffset {}
554    #[derive(Copy, Clone, PartialEq)]
555
556    pub struct PutResponse<'a> {
557        pub _tab: flatbuffers::Table<'a>,
558    }
559
560    impl<'a> flatbuffers::Follow<'a> for PutResponse<'a> {
561        type Inner = PutResponse<'a>;
562        #[inline]
563        unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
564            Self {
565                _tab: flatbuffers::Table::new(buf, loc),
566            }
567        }
568    }
569
570    impl<'a> PutResponse<'a> {
571        pub const VT_KEY: flatbuffers::VOffsetT = 4;
572
573        #[inline]
574        pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
575            PutResponse { _tab: table }
576        }
577        #[allow(unused_mut)]
578        pub fn create<
579            'bldr: 'args,
580            'args: 'mut_bldr,
581            'mut_bldr,
582            A: flatbuffers::Allocator + 'bldr,
583        >(
584            _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
585            args: &'args PutResponseArgs<'args>,
586        ) -> flatbuffers::WIPOffset<PutResponse<'bldr>> {
587            let mut builder = PutResponseBuilder::new(_fbb);
588            if let Some(x) = args.key {
589                builder.add_key(x);
590            }
591            builder.finish()
592        }
593
594        #[inline]
595        pub fn key(&self) -> super::common::ContractKey<'a> {
596            // Safety:
597            // Created from valid Table for this object
598            // which contains a valid value in this slot
599            unsafe {
600                self._tab
601                    .get::<flatbuffers::ForwardsUOffset<super::common::ContractKey>>(
602                        PutResponse::VT_KEY,
603                        None,
604                    )
605                    .unwrap()
606            }
607        }
608    }
609
610    impl flatbuffers::Verifiable for PutResponse<'_> {
611        #[inline]
612        fn run_verifier(
613            v: &mut flatbuffers::Verifier,
614            pos: usize,
615        ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
616            use self::flatbuffers::Verifiable;
617            v.visit_table(pos)?
618                .visit_field::<flatbuffers::ForwardsUOffset<super::common::ContractKey>>(
619                    "key",
620                    Self::VT_KEY,
621                    true,
622                )?
623                .finish();
624            Ok(())
625        }
626    }
627    pub struct PutResponseArgs<'a> {
628        pub key: Option<flatbuffers::WIPOffset<super::common::ContractKey<'a>>>,
629    }
630    impl<'a> Default for PutResponseArgs<'a> {
631        #[inline]
632        fn default() -> Self {
633            PutResponseArgs {
634                key: None, // required field
635            }
636        }
637    }
638
639    pub struct PutResponseBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
640        fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
641        start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
642    }
643    impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> PutResponseBuilder<'a, 'b, A> {
644        #[inline]
645        pub fn add_key(&mut self, key: flatbuffers::WIPOffset<super::common::ContractKey<'b>>) {
646            self.fbb_
647                .push_slot_always::<flatbuffers::WIPOffset<super::common::ContractKey>>(
648                    PutResponse::VT_KEY,
649                    key,
650                );
651        }
652        #[inline]
653        pub fn new(
654            _fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
655        ) -> PutResponseBuilder<'a, 'b, A> {
656            let start = _fbb.start_table();
657            PutResponseBuilder {
658                fbb_: _fbb,
659                start_: start,
660            }
661        }
662        #[inline]
663        pub fn finish(self) -> flatbuffers::WIPOffset<PutResponse<'a>> {
664            let o = self.fbb_.end_table(self.start_);
665            self.fbb_.required(o, PutResponse::VT_KEY, "key");
666            flatbuffers::WIPOffset::new(o.value())
667        }
668    }
669
670    impl core::fmt::Debug for PutResponse<'_> {
671        fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
672            let mut ds = f.debug_struct("PutResponse");
673            ds.field("key", &self.key());
674            ds.finish()
675        }
676    }
677    pub enum UpdateNotificationOffset {}
678    #[derive(Copy, Clone, PartialEq)]
679
680    pub struct UpdateNotification<'a> {
681        pub _tab: flatbuffers::Table<'a>,
682    }
683
684    impl<'a> flatbuffers::Follow<'a> for UpdateNotification<'a> {
685        type Inner = UpdateNotification<'a>;
686        #[inline]
687        unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
688            Self {
689                _tab: flatbuffers::Table::new(buf, loc),
690            }
691        }
692    }
693
694    impl<'a> UpdateNotification<'a> {
695        pub const VT_KEY: flatbuffers::VOffsetT = 4;
696        pub const VT_UPDATE: flatbuffers::VOffsetT = 6;
697
698        #[inline]
699        pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
700            UpdateNotification { _tab: table }
701        }
702        #[allow(unused_mut)]
703        pub fn create<
704            'bldr: 'args,
705            'args: 'mut_bldr,
706            'mut_bldr,
707            A: flatbuffers::Allocator + 'bldr,
708        >(
709            _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
710            args: &'args UpdateNotificationArgs<'args>,
711        ) -> flatbuffers::WIPOffset<UpdateNotification<'bldr>> {
712            let mut builder = UpdateNotificationBuilder::new(_fbb);
713            if let Some(x) = args.update {
714                builder.add_update(x);
715            }
716            if let Some(x) = args.key {
717                builder.add_key(x);
718            }
719            builder.finish()
720        }
721
722        #[inline]
723        pub fn key(&self) -> super::common::ContractKey<'a> {
724            // Safety:
725            // Created from valid Table for this object
726            // which contains a valid value in this slot
727            unsafe {
728                self._tab
729                    .get::<flatbuffers::ForwardsUOffset<super::common::ContractKey>>(
730                        UpdateNotification::VT_KEY,
731                        None,
732                    )
733                    .unwrap()
734            }
735        }
736        #[inline]
737        pub fn update(&self) -> super::common::UpdateData<'a> {
738            // Safety:
739            // Created from valid Table for this object
740            // which contains a valid value in this slot
741            unsafe {
742                self._tab
743                    .get::<flatbuffers::ForwardsUOffset<super::common::UpdateData>>(
744                        UpdateNotification::VT_UPDATE,
745                        None,
746                    )
747                    .unwrap()
748            }
749        }
750    }
751
752    impl flatbuffers::Verifiable for UpdateNotification<'_> {
753        #[inline]
754        fn run_verifier(
755            v: &mut flatbuffers::Verifier,
756            pos: usize,
757        ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
758            use self::flatbuffers::Verifiable;
759            v.visit_table(pos)?
760                .visit_field::<flatbuffers::ForwardsUOffset<super::common::ContractKey>>(
761                    "key",
762                    Self::VT_KEY,
763                    true,
764                )?
765                .visit_field::<flatbuffers::ForwardsUOffset<super::common::UpdateData>>(
766                    "update",
767                    Self::VT_UPDATE,
768                    true,
769                )?
770                .finish();
771            Ok(())
772        }
773    }
774    pub struct UpdateNotificationArgs<'a> {
775        pub key: Option<flatbuffers::WIPOffset<super::common::ContractKey<'a>>>,
776        pub update: Option<flatbuffers::WIPOffset<super::common::UpdateData<'a>>>,
777    }
778    impl<'a> Default for UpdateNotificationArgs<'a> {
779        #[inline]
780        fn default() -> Self {
781            UpdateNotificationArgs {
782                key: None,    // required field
783                update: None, // required field
784            }
785        }
786    }
787
788    pub struct UpdateNotificationBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
789        fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
790        start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
791    }
792    impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> UpdateNotificationBuilder<'a, 'b, A> {
793        #[inline]
794        pub fn add_key(&mut self, key: flatbuffers::WIPOffset<super::common::ContractKey<'b>>) {
795            self.fbb_
796                .push_slot_always::<flatbuffers::WIPOffset<super::common::ContractKey>>(
797                    UpdateNotification::VT_KEY,
798                    key,
799                );
800        }
801        #[inline]
802        pub fn add_update(
803            &mut self,
804            update: flatbuffers::WIPOffset<super::common::UpdateData<'b>>,
805        ) {
806            self.fbb_
807                .push_slot_always::<flatbuffers::WIPOffset<super::common::UpdateData>>(
808                    UpdateNotification::VT_UPDATE,
809                    update,
810                );
811        }
812        #[inline]
813        pub fn new(
814            _fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
815        ) -> UpdateNotificationBuilder<'a, 'b, A> {
816            let start = _fbb.start_table();
817            UpdateNotificationBuilder {
818                fbb_: _fbb,
819                start_: start,
820            }
821        }
822        #[inline]
823        pub fn finish(self) -> flatbuffers::WIPOffset<UpdateNotification<'a>> {
824            let o = self.fbb_.end_table(self.start_);
825            self.fbb_.required(o, UpdateNotification::VT_KEY, "key");
826            self.fbb_
827                .required(o, UpdateNotification::VT_UPDATE, "update");
828            flatbuffers::WIPOffset::new(o.value())
829        }
830    }
831
832    impl core::fmt::Debug for UpdateNotification<'_> {
833        fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
834            let mut ds = f.debug_struct("UpdateNotification");
835            ds.field("key", &self.key());
836            ds.field("update", &self.update());
837            ds.finish()
838        }
839    }
840    pub enum UpdateResponseOffset {}
841    #[derive(Copy, Clone, PartialEq)]
842
843    pub struct UpdateResponse<'a> {
844        pub _tab: flatbuffers::Table<'a>,
845    }
846
847    impl<'a> flatbuffers::Follow<'a> for UpdateResponse<'a> {
848        type Inner = UpdateResponse<'a>;
849        #[inline]
850        unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
851            Self {
852                _tab: flatbuffers::Table::new(buf, loc),
853            }
854        }
855    }
856
857    impl<'a> UpdateResponse<'a> {
858        pub const VT_KEY: flatbuffers::VOffsetT = 4;
859        pub const VT_SUMMARY: flatbuffers::VOffsetT = 6;
860
861        #[inline]
862        pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
863            UpdateResponse { _tab: table }
864        }
865        #[allow(unused_mut)]
866        pub fn create<
867            'bldr: 'args,
868            'args: 'mut_bldr,
869            'mut_bldr,
870            A: flatbuffers::Allocator + 'bldr,
871        >(
872            _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
873            args: &'args UpdateResponseArgs<'args>,
874        ) -> flatbuffers::WIPOffset<UpdateResponse<'bldr>> {
875            let mut builder = UpdateResponseBuilder::new(_fbb);
876            if let Some(x) = args.summary {
877                builder.add_summary(x);
878            }
879            if let Some(x) = args.key {
880                builder.add_key(x);
881            }
882            builder.finish()
883        }
884
885        #[inline]
886        pub fn key(&self) -> super::common::ContractKey<'a> {
887            // Safety:
888            // Created from valid Table for this object
889            // which contains a valid value in this slot
890            unsafe {
891                self._tab
892                    .get::<flatbuffers::ForwardsUOffset<super::common::ContractKey>>(
893                        UpdateResponse::VT_KEY,
894                        None,
895                    )
896                    .unwrap()
897            }
898        }
899        #[inline]
900        pub fn summary(&self) -> flatbuffers::Vector<'a, u8> {
901            // Safety:
902            // Created from valid Table for this object
903            // which contains a valid value in this slot
904            unsafe {
905                self._tab
906                    .get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, u8>>>(
907                        UpdateResponse::VT_SUMMARY,
908                        None,
909                    )
910                    .unwrap()
911            }
912        }
913    }
914
915    impl flatbuffers::Verifiable for UpdateResponse<'_> {
916        #[inline]
917        fn run_verifier(
918            v: &mut flatbuffers::Verifier,
919            pos: usize,
920        ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
921            use self::flatbuffers::Verifiable;
922            v.visit_table(pos)?
923                .visit_field::<flatbuffers::ForwardsUOffset<super::common::ContractKey>>(
924                    "key",
925                    Self::VT_KEY,
926                    true,
927                )?
928                .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, u8>>>(
929                    "summary",
930                    Self::VT_SUMMARY,
931                    true,
932                )?
933                .finish();
934            Ok(())
935        }
936    }
937    pub struct UpdateResponseArgs<'a> {
938        pub key: Option<flatbuffers::WIPOffset<super::common::ContractKey<'a>>>,
939        pub summary: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, u8>>>,
940    }
941    impl<'a> Default for UpdateResponseArgs<'a> {
942        #[inline]
943        fn default() -> Self {
944            UpdateResponseArgs {
945                key: None,     // required field
946                summary: None, // required field
947            }
948        }
949    }
950
951    pub struct UpdateResponseBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
952        fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
953        start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
954    }
955    impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> UpdateResponseBuilder<'a, 'b, A> {
956        #[inline]
957        pub fn add_key(&mut self, key: flatbuffers::WIPOffset<super::common::ContractKey<'b>>) {
958            self.fbb_
959                .push_slot_always::<flatbuffers::WIPOffset<super::common::ContractKey>>(
960                    UpdateResponse::VT_KEY,
961                    key,
962                );
963        }
964        #[inline]
965        pub fn add_summary(
966            &mut self,
967            summary: flatbuffers::WIPOffset<flatbuffers::Vector<'b, u8>>,
968        ) {
969            self.fbb_
970                .push_slot_always::<flatbuffers::WIPOffset<_>>(UpdateResponse::VT_SUMMARY, summary);
971        }
972        #[inline]
973        pub fn new(
974            _fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
975        ) -> UpdateResponseBuilder<'a, 'b, A> {
976            let start = _fbb.start_table();
977            UpdateResponseBuilder {
978                fbb_: _fbb,
979                start_: start,
980            }
981        }
982        #[inline]
983        pub fn finish(self) -> flatbuffers::WIPOffset<UpdateResponse<'a>> {
984            let o = self.fbb_.end_table(self.start_);
985            self.fbb_.required(o, UpdateResponse::VT_KEY, "key");
986            self.fbb_.required(o, UpdateResponse::VT_SUMMARY, "summary");
987            flatbuffers::WIPOffset::new(o.value())
988        }
989    }
990
991    impl core::fmt::Debug for UpdateResponse<'_> {
992        fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
993            let mut ds = f.debug_struct("UpdateResponse");
994            ds.field("key", &self.key());
995            ds.field("summary", &self.summary());
996            ds.finish()
997        }
998    }
999    pub enum ContractResponseOffset {}
1000    #[derive(Copy, Clone, PartialEq)]
1001
1002    pub struct ContractResponse<'a> {
1003        pub _tab: flatbuffers::Table<'a>,
1004    }
1005
1006    impl<'a> flatbuffers::Follow<'a> for ContractResponse<'a> {
1007        type Inner = ContractResponse<'a>;
1008        #[inline]
1009        unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
1010            Self {
1011                _tab: flatbuffers::Table::new(buf, loc),
1012            }
1013        }
1014    }
1015
1016    impl<'a> ContractResponse<'a> {
1017        pub const VT_CONTRACT_RESPONSE_TYPE: flatbuffers::VOffsetT = 4;
1018        pub const VT_CONTRACT_RESPONSE: flatbuffers::VOffsetT = 6;
1019
1020        #[inline]
1021        pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
1022            ContractResponse { _tab: table }
1023        }
1024        #[allow(unused_mut)]
1025        pub fn create<
1026            'bldr: 'args,
1027            'args: 'mut_bldr,
1028            'mut_bldr,
1029            A: flatbuffers::Allocator + 'bldr,
1030        >(
1031            _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
1032            args: &'args ContractResponseArgs,
1033        ) -> flatbuffers::WIPOffset<ContractResponse<'bldr>> {
1034            let mut builder = ContractResponseBuilder::new(_fbb);
1035            if let Some(x) = args.contract_response {
1036                builder.add_contract_response(x);
1037            }
1038            builder.add_contract_response_type(args.contract_response_type);
1039            builder.finish()
1040        }
1041
1042        #[inline]
1043        pub fn contract_response_type(&self) -> ContractResponseType {
1044            // Safety:
1045            // Created from valid Table for this object
1046            // which contains a valid value in this slot
1047            unsafe {
1048                self._tab
1049                    .get::<ContractResponseType>(
1050                        ContractResponse::VT_CONTRACT_RESPONSE_TYPE,
1051                        Some(ContractResponseType::NONE),
1052                    )
1053                    .unwrap()
1054            }
1055        }
1056        #[inline]
1057        pub fn contract_response(&self) -> flatbuffers::Table<'a> {
1058            // Safety:
1059            // Created from valid Table for this object
1060            // which contains a valid value in this slot
1061            unsafe {
1062                self._tab
1063                    .get::<flatbuffers::ForwardsUOffset<flatbuffers::Table<'a>>>(
1064                        ContractResponse::VT_CONTRACT_RESPONSE,
1065                        None,
1066                    )
1067                    .unwrap()
1068            }
1069        }
1070        #[inline]
1071        #[allow(non_snake_case)]
1072        pub fn contract_response_as_get_response(&self) -> Option<GetResponse<'a>> {
1073            if self.contract_response_type() == ContractResponseType::GetResponse {
1074                let u = self.contract_response();
1075                // Safety:
1076                // Created from a valid Table for this object
1077                // Which contains a valid union in this slot
1078                Some(unsafe { GetResponse::init_from_table(u) })
1079            } else {
1080                None
1081            }
1082        }
1083
1084        #[inline]
1085        #[allow(non_snake_case)]
1086        pub fn contract_response_as_put_response(&self) -> Option<PutResponse<'a>> {
1087            if self.contract_response_type() == ContractResponseType::PutResponse {
1088                let u = self.contract_response();
1089                // Safety:
1090                // Created from a valid Table for this object
1091                // Which contains a valid union in this slot
1092                Some(unsafe { PutResponse::init_from_table(u) })
1093            } else {
1094                None
1095            }
1096        }
1097
1098        #[inline]
1099        #[allow(non_snake_case)]
1100        pub fn contract_response_as_update_notification(&self) -> Option<UpdateNotification<'a>> {
1101            if self.contract_response_type() == ContractResponseType::UpdateNotification {
1102                let u = self.contract_response();
1103                // Safety:
1104                // Created from a valid Table for this object
1105                // Which contains a valid union in this slot
1106                Some(unsafe { UpdateNotification::init_from_table(u) })
1107            } else {
1108                None
1109            }
1110        }
1111
1112        #[inline]
1113        #[allow(non_snake_case)]
1114        pub fn contract_response_as_update_response(&self) -> Option<UpdateResponse<'a>> {
1115            if self.contract_response_type() == ContractResponseType::UpdateResponse {
1116                let u = self.contract_response();
1117                // Safety:
1118                // Created from a valid Table for this object
1119                // Which contains a valid union in this slot
1120                Some(unsafe { UpdateResponse::init_from_table(u) })
1121            } else {
1122                None
1123            }
1124        }
1125    }
1126
1127    impl flatbuffers::Verifiable for ContractResponse<'_> {
1128        #[inline]
1129        fn run_verifier(
1130            v: &mut flatbuffers::Verifier,
1131            pos: usize,
1132        ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
1133            use self::flatbuffers::Verifiable;
1134            v.visit_table(pos)?
1135     .visit_union::<ContractResponseType, _>("contract_response_type", Self::VT_CONTRACT_RESPONSE_TYPE, "contract_response", Self::VT_CONTRACT_RESPONSE, true, |key, v, pos| {
1136        match key {
1137          ContractResponseType::GetResponse => v.verify_union_variant::<flatbuffers::ForwardsUOffset<GetResponse>>("ContractResponseType::GetResponse", pos),
1138          ContractResponseType::PutResponse => v.verify_union_variant::<flatbuffers::ForwardsUOffset<PutResponse>>("ContractResponseType::PutResponse", pos),
1139          ContractResponseType::UpdateNotification => v.verify_union_variant::<flatbuffers::ForwardsUOffset<UpdateNotification>>("ContractResponseType::UpdateNotification", pos),
1140          ContractResponseType::UpdateResponse => v.verify_union_variant::<flatbuffers::ForwardsUOffset<UpdateResponse>>("ContractResponseType::UpdateResponse", pos),
1141          _ => Ok(()),
1142        }
1143     })?
1144     .finish();
1145            Ok(())
1146        }
1147    }
1148    pub struct ContractResponseArgs {
1149        pub contract_response_type: ContractResponseType,
1150        pub contract_response: Option<flatbuffers::WIPOffset<flatbuffers::UnionWIPOffset>>,
1151    }
1152    impl<'a> Default for ContractResponseArgs {
1153        #[inline]
1154        fn default() -> Self {
1155            ContractResponseArgs {
1156                contract_response_type: ContractResponseType::NONE,
1157                contract_response: None, // required field
1158            }
1159        }
1160    }
1161
1162    pub struct ContractResponseBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
1163        fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
1164        start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
1165    }
1166    impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> ContractResponseBuilder<'a, 'b, A> {
1167        #[inline]
1168        pub fn add_contract_response_type(&mut self, contract_response_type: ContractResponseType) {
1169            self.fbb_.push_slot::<ContractResponseType>(
1170                ContractResponse::VT_CONTRACT_RESPONSE_TYPE,
1171                contract_response_type,
1172                ContractResponseType::NONE,
1173            );
1174        }
1175        #[inline]
1176        pub fn add_contract_response(
1177            &mut self,
1178            contract_response: flatbuffers::WIPOffset<flatbuffers::UnionWIPOffset>,
1179        ) {
1180            self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(
1181                ContractResponse::VT_CONTRACT_RESPONSE,
1182                contract_response,
1183            );
1184        }
1185        #[inline]
1186        pub fn new(
1187            _fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
1188        ) -> ContractResponseBuilder<'a, 'b, A> {
1189            let start = _fbb.start_table();
1190            ContractResponseBuilder {
1191                fbb_: _fbb,
1192                start_: start,
1193            }
1194        }
1195        #[inline]
1196        pub fn finish(self) -> flatbuffers::WIPOffset<ContractResponse<'a>> {
1197            let o = self.fbb_.end_table(self.start_);
1198            self.fbb_.required(
1199                o,
1200                ContractResponse::VT_CONTRACT_RESPONSE,
1201                "contract_response",
1202            );
1203            flatbuffers::WIPOffset::new(o.value())
1204        }
1205    }
1206
1207    impl core::fmt::Debug for ContractResponse<'_> {
1208        fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
1209            let mut ds = f.debug_struct("ContractResponse");
1210            ds.field("contract_response_type", &self.contract_response_type());
1211            match self.contract_response_type() {
1212                ContractResponseType::GetResponse => {
1213                    if let Some(x) = self.contract_response_as_get_response() {
1214                        ds.field("contract_response", &x)
1215                    } else {
1216                        ds.field(
1217                            "contract_response",
1218                            &"InvalidFlatbuffer: Union discriminant does not match value.",
1219                        )
1220                    }
1221                }
1222                ContractResponseType::PutResponse => {
1223                    if let Some(x) = self.contract_response_as_put_response() {
1224                        ds.field("contract_response", &x)
1225                    } else {
1226                        ds.field(
1227                            "contract_response",
1228                            &"InvalidFlatbuffer: Union discriminant does not match value.",
1229                        )
1230                    }
1231                }
1232                ContractResponseType::UpdateNotification => {
1233                    if let Some(x) = self.contract_response_as_update_notification() {
1234                        ds.field("contract_response", &x)
1235                    } else {
1236                        ds.field(
1237                            "contract_response",
1238                            &"InvalidFlatbuffer: Union discriminant does not match value.",
1239                        )
1240                    }
1241                }
1242                ContractResponseType::UpdateResponse => {
1243                    if let Some(x) = self.contract_response_as_update_response() {
1244                        ds.field("contract_response", &x)
1245                    } else {
1246                        ds.field(
1247                            "contract_response",
1248                            &"InvalidFlatbuffer: Union discriminant does not match value.",
1249                        )
1250                    }
1251                }
1252                _ => {
1253                    let x: Option<()> = None;
1254                    ds.field("contract_response", &x)
1255                }
1256            };
1257            ds.finish()
1258        }
1259    }
1260    pub enum DelegateKeyOffset {}
1261    #[derive(Copy, Clone, PartialEq)]
1262
1263    pub struct DelegateKey<'a> {
1264        pub _tab: flatbuffers::Table<'a>,
1265    }
1266
1267    impl<'a> flatbuffers::Follow<'a> for DelegateKey<'a> {
1268        type Inner = DelegateKey<'a>;
1269        #[inline]
1270        unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
1271            Self {
1272                _tab: flatbuffers::Table::new(buf, loc),
1273            }
1274        }
1275    }
1276
1277    impl<'a> DelegateKey<'a> {
1278        pub const VT_KEY: flatbuffers::VOffsetT = 4;
1279        pub const VT_CODE_HASH: flatbuffers::VOffsetT = 6;
1280
1281        #[inline]
1282        pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
1283            DelegateKey { _tab: table }
1284        }
1285        #[allow(unused_mut)]
1286        pub fn create<
1287            'bldr: 'args,
1288            'args: 'mut_bldr,
1289            'mut_bldr,
1290            A: flatbuffers::Allocator + 'bldr,
1291        >(
1292            _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
1293            args: &'args DelegateKeyArgs<'args>,
1294        ) -> flatbuffers::WIPOffset<DelegateKey<'bldr>> {
1295            let mut builder = DelegateKeyBuilder::new(_fbb);
1296            if let Some(x) = args.code_hash {
1297                builder.add_code_hash(x);
1298            }
1299            if let Some(x) = args.key {
1300                builder.add_key(x);
1301            }
1302            builder.finish()
1303        }
1304
1305        #[inline]
1306        pub fn key(&self) -> flatbuffers::Vector<'a, u8> {
1307            // Safety:
1308            // Created from valid Table for this object
1309            // which contains a valid value in this slot
1310            unsafe {
1311                self._tab
1312                    .get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, u8>>>(
1313                        DelegateKey::VT_KEY,
1314                        None,
1315                    )
1316                    .unwrap()
1317            }
1318        }
1319        #[inline]
1320        pub fn code_hash(&self) -> flatbuffers::Vector<'a, u8> {
1321            // Safety:
1322            // Created from valid Table for this object
1323            // which contains a valid value in this slot
1324            unsafe {
1325                self._tab
1326                    .get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, u8>>>(
1327                        DelegateKey::VT_CODE_HASH,
1328                        None,
1329                    )
1330                    .unwrap()
1331            }
1332        }
1333    }
1334
1335    impl flatbuffers::Verifiable for DelegateKey<'_> {
1336        #[inline]
1337        fn run_verifier(
1338            v: &mut flatbuffers::Verifier,
1339            pos: usize,
1340        ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
1341            use self::flatbuffers::Verifiable;
1342            v.visit_table(pos)?
1343                .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, u8>>>(
1344                    "key",
1345                    Self::VT_KEY,
1346                    true,
1347                )?
1348                .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, u8>>>(
1349                    "code_hash",
1350                    Self::VT_CODE_HASH,
1351                    true,
1352                )?
1353                .finish();
1354            Ok(())
1355        }
1356    }
1357    pub struct DelegateKeyArgs<'a> {
1358        pub key: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, u8>>>,
1359        pub code_hash: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, u8>>>,
1360    }
1361    impl<'a> Default for DelegateKeyArgs<'a> {
1362        #[inline]
1363        fn default() -> Self {
1364            DelegateKeyArgs {
1365                key: None,       // required field
1366                code_hash: None, // required field
1367            }
1368        }
1369    }
1370
1371    pub struct DelegateKeyBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
1372        fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
1373        start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
1374    }
1375    impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> DelegateKeyBuilder<'a, 'b, A> {
1376        #[inline]
1377        pub fn add_key(&mut self, key: flatbuffers::WIPOffset<flatbuffers::Vector<'b, u8>>) {
1378            self.fbb_
1379                .push_slot_always::<flatbuffers::WIPOffset<_>>(DelegateKey::VT_KEY, key);
1380        }
1381        #[inline]
1382        pub fn add_code_hash(
1383            &mut self,
1384            code_hash: flatbuffers::WIPOffset<flatbuffers::Vector<'b, u8>>,
1385        ) {
1386            self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(
1387                DelegateKey::VT_CODE_HASH,
1388                code_hash,
1389            );
1390        }
1391        #[inline]
1392        pub fn new(
1393            _fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
1394        ) -> DelegateKeyBuilder<'a, 'b, A> {
1395            let start = _fbb.start_table();
1396            DelegateKeyBuilder {
1397                fbb_: _fbb,
1398                start_: start,
1399            }
1400        }
1401        #[inline]
1402        pub fn finish(self) -> flatbuffers::WIPOffset<DelegateKey<'a>> {
1403            let o = self.fbb_.end_table(self.start_);
1404            self.fbb_.required(o, DelegateKey::VT_KEY, "key");
1405            self.fbb_
1406                .required(o, DelegateKey::VT_CODE_HASH, "code_hash");
1407            flatbuffers::WIPOffset::new(o.value())
1408        }
1409    }
1410
1411    impl core::fmt::Debug for DelegateKey<'_> {
1412        fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
1413            let mut ds = f.debug_struct("DelegateKey");
1414            ds.field("key", &self.key());
1415            ds.field("code_hash", &self.code_hash());
1416            ds.finish()
1417        }
1418    }
1419    pub enum UserInputRequestOffset {}
1420    #[derive(Copy, Clone, PartialEq)]
1421
1422    pub struct UserInputRequest<'a> {
1423        pub _tab: flatbuffers::Table<'a>,
1424    }
1425
1426    impl<'a> flatbuffers::Follow<'a> for UserInputRequest<'a> {
1427        type Inner = UserInputRequest<'a>;
1428        #[inline]
1429        unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
1430            Self {
1431                _tab: flatbuffers::Table::new(buf, loc),
1432            }
1433        }
1434    }
1435
1436    impl<'a> UserInputRequest<'a> {
1437        pub const VT_REQUEST_ID: flatbuffers::VOffsetT = 4;
1438        pub const VT_MESSAGE: flatbuffers::VOffsetT = 6;
1439        pub const VT_RESPONSES: flatbuffers::VOffsetT = 8;
1440
1441        #[inline]
1442        pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
1443            UserInputRequest { _tab: table }
1444        }
1445        #[allow(unused_mut)]
1446        pub fn create<
1447            'bldr: 'args,
1448            'args: 'mut_bldr,
1449            'mut_bldr,
1450            A: flatbuffers::Allocator + 'bldr,
1451        >(
1452            _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
1453            args: &'args UserInputRequestArgs<'args>,
1454        ) -> flatbuffers::WIPOffset<UserInputRequest<'bldr>> {
1455            let mut builder = UserInputRequestBuilder::new(_fbb);
1456            if let Some(x) = args.responses {
1457                builder.add_responses(x);
1458            }
1459            if let Some(x) = args.message {
1460                builder.add_message(x);
1461            }
1462            builder.add_request_id(args.request_id);
1463            builder.finish()
1464        }
1465
1466        #[inline]
1467        pub fn request_id(&self) -> u32 {
1468            // Safety:
1469            // Created from valid Table for this object
1470            // which contains a valid value in this slot
1471            unsafe {
1472                self._tab
1473                    .get::<u32>(UserInputRequest::VT_REQUEST_ID, Some(0))
1474                    .unwrap()
1475            }
1476        }
1477        #[inline]
1478        pub fn message(&self) -> flatbuffers::Vector<'a, u8> {
1479            // Safety:
1480            // Created from valid Table for this object
1481            // which contains a valid value in this slot
1482            unsafe {
1483                self._tab
1484                    .get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, u8>>>(
1485                        UserInputRequest::VT_MESSAGE,
1486                        None,
1487                    )
1488                    .unwrap()
1489            }
1490        }
1491        #[inline]
1492        pub fn responses(
1493            &self,
1494        ) -> flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<ClientResponse<'a>>> {
1495            // Safety:
1496            // Created from valid Table for this object
1497            // which contains a valid value in this slot
1498            unsafe {
1499                self._tab
1500                    .get::<flatbuffers::ForwardsUOffset<
1501                        flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<ClientResponse>>,
1502                    >>(UserInputRequest::VT_RESPONSES, None)
1503                    .unwrap()
1504            }
1505        }
1506    }
1507
1508    impl flatbuffers::Verifiable for UserInputRequest<'_> {
1509        #[inline]
1510        fn run_verifier(
1511            v: &mut flatbuffers::Verifier,
1512            pos: usize,
1513        ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
1514            use self::flatbuffers::Verifiable;
1515            v.visit_table(pos)?
1516                .visit_field::<u32>("request_id", Self::VT_REQUEST_ID, false)?
1517                .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, u8>>>(
1518                    "message",
1519                    Self::VT_MESSAGE,
1520                    true,
1521                )?
1522                .visit_field::<flatbuffers::ForwardsUOffset<
1523                    flatbuffers::Vector<'_, flatbuffers::ForwardsUOffset<ClientResponse>>,
1524                >>("responses", Self::VT_RESPONSES, true)?
1525                .finish();
1526            Ok(())
1527        }
1528    }
1529    pub struct UserInputRequestArgs<'a> {
1530        pub request_id: u32,
1531        pub message: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, u8>>>,
1532        pub responses: Option<
1533            flatbuffers::WIPOffset<
1534                flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<ClientResponse<'a>>>,
1535            >,
1536        >,
1537    }
1538    impl<'a> Default for UserInputRequestArgs<'a> {
1539        #[inline]
1540        fn default() -> Self {
1541            UserInputRequestArgs {
1542                request_id: 0,
1543                message: None,   // required field
1544                responses: None, // required field
1545            }
1546        }
1547    }
1548
1549    pub struct UserInputRequestBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
1550        fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
1551        start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
1552    }
1553    impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> UserInputRequestBuilder<'a, 'b, A> {
1554        #[inline]
1555        pub fn add_request_id(&mut self, request_id: u32) {
1556            self.fbb_
1557                .push_slot::<u32>(UserInputRequest::VT_REQUEST_ID, request_id, 0);
1558        }
1559        #[inline]
1560        pub fn add_message(
1561            &mut self,
1562            message: flatbuffers::WIPOffset<flatbuffers::Vector<'b, u8>>,
1563        ) {
1564            self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(
1565                UserInputRequest::VT_MESSAGE,
1566                message,
1567            );
1568        }
1569        #[inline]
1570        pub fn add_responses(
1571            &mut self,
1572            responses: flatbuffers::WIPOffset<
1573                flatbuffers::Vector<'b, flatbuffers::ForwardsUOffset<ClientResponse<'b>>>,
1574            >,
1575        ) {
1576            self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(
1577                UserInputRequest::VT_RESPONSES,
1578                responses,
1579            );
1580        }
1581        #[inline]
1582        pub fn new(
1583            _fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
1584        ) -> UserInputRequestBuilder<'a, 'b, A> {
1585            let start = _fbb.start_table();
1586            UserInputRequestBuilder {
1587                fbb_: _fbb,
1588                start_: start,
1589            }
1590        }
1591        #[inline]
1592        pub fn finish(self) -> flatbuffers::WIPOffset<UserInputRequest<'a>> {
1593            let o = self.fbb_.end_table(self.start_);
1594            self.fbb_
1595                .required(o, UserInputRequest::VT_MESSAGE, "message");
1596            self.fbb_
1597                .required(o, UserInputRequest::VT_RESPONSES, "responses");
1598            flatbuffers::WIPOffset::new(o.value())
1599        }
1600    }
1601
1602    impl core::fmt::Debug for UserInputRequest<'_> {
1603        fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
1604            let mut ds = f.debug_struct("UserInputRequest");
1605            ds.field("request_id", &self.request_id());
1606            ds.field("message", &self.message());
1607            ds.field("responses", &self.responses());
1608            ds.finish()
1609        }
1610    }
1611    pub enum ClientResponseOffset {}
1612    #[derive(Copy, Clone, PartialEq)]
1613
1614    pub struct ClientResponse<'a> {
1615        pub _tab: flatbuffers::Table<'a>,
1616    }
1617
1618    impl<'a> flatbuffers::Follow<'a> for ClientResponse<'a> {
1619        type Inner = ClientResponse<'a>;
1620        #[inline]
1621        unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
1622            Self {
1623                _tab: flatbuffers::Table::new(buf, loc),
1624            }
1625        }
1626    }
1627
1628    impl<'a> ClientResponse<'a> {
1629        pub const VT_DATA: flatbuffers::VOffsetT = 4;
1630
1631        #[inline]
1632        pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
1633            ClientResponse { _tab: table }
1634        }
1635        #[allow(unused_mut)]
1636        pub fn create<
1637            'bldr: 'args,
1638            'args: 'mut_bldr,
1639            'mut_bldr,
1640            A: flatbuffers::Allocator + 'bldr,
1641        >(
1642            _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
1643            args: &'args ClientResponseArgs<'args>,
1644        ) -> flatbuffers::WIPOffset<ClientResponse<'bldr>> {
1645            let mut builder = ClientResponseBuilder::new(_fbb);
1646            if let Some(x) = args.data {
1647                builder.add_data(x);
1648            }
1649            builder.finish()
1650        }
1651
1652        #[inline]
1653        pub fn data(&self) -> Option<flatbuffers::Vector<'a, u8>> {
1654            // Safety:
1655            // Created from valid Table for this object
1656            // which contains a valid value in this slot
1657            unsafe {
1658                self._tab
1659                    .get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, u8>>>(
1660                        ClientResponse::VT_DATA,
1661                        None,
1662                    )
1663            }
1664        }
1665    }
1666
1667    impl flatbuffers::Verifiable for ClientResponse<'_> {
1668        #[inline]
1669        fn run_verifier(
1670            v: &mut flatbuffers::Verifier,
1671            pos: usize,
1672        ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
1673            use self::flatbuffers::Verifiable;
1674            v.visit_table(pos)?
1675                .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, u8>>>(
1676                    "data",
1677                    Self::VT_DATA,
1678                    false,
1679                )?
1680                .finish();
1681            Ok(())
1682        }
1683    }
1684    pub struct ClientResponseArgs<'a> {
1685        pub data: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, u8>>>,
1686    }
1687    impl<'a> Default for ClientResponseArgs<'a> {
1688        #[inline]
1689        fn default() -> Self {
1690            ClientResponseArgs { data: None }
1691        }
1692    }
1693
1694    pub struct ClientResponseBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
1695        fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
1696        start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
1697    }
1698    impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> ClientResponseBuilder<'a, 'b, A> {
1699        #[inline]
1700        pub fn add_data(&mut self, data: flatbuffers::WIPOffset<flatbuffers::Vector<'b, u8>>) {
1701            self.fbb_
1702                .push_slot_always::<flatbuffers::WIPOffset<_>>(ClientResponse::VT_DATA, data);
1703        }
1704        #[inline]
1705        pub fn new(
1706            _fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
1707        ) -> ClientResponseBuilder<'a, 'b, A> {
1708            let start = _fbb.start_table();
1709            ClientResponseBuilder {
1710                fbb_: _fbb,
1711                start_: start,
1712            }
1713        }
1714        #[inline]
1715        pub fn finish(self) -> flatbuffers::WIPOffset<ClientResponse<'a>> {
1716            let o = self.fbb_.end_table(self.start_);
1717            flatbuffers::WIPOffset::new(o.value())
1718        }
1719    }
1720
1721    impl core::fmt::Debug for ClientResponse<'_> {
1722        fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
1723            let mut ds = f.debug_struct("ClientResponse");
1724            ds.field("data", &self.data());
1725            ds.finish()
1726        }
1727    }
1728    pub enum RequestUserInputOffset {}
1729    #[derive(Copy, Clone, PartialEq)]
1730
1731    pub struct RequestUserInput<'a> {
1732        pub _tab: flatbuffers::Table<'a>,
1733    }
1734
1735    impl<'a> flatbuffers::Follow<'a> for RequestUserInput<'a> {
1736        type Inner = RequestUserInput<'a>;
1737        #[inline]
1738        unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
1739            Self {
1740                _tab: flatbuffers::Table::new(buf, loc),
1741            }
1742        }
1743    }
1744
1745    impl<'a> RequestUserInput<'a> {
1746        pub const VT_REQUEST_ID: flatbuffers::VOffsetT = 4;
1747        pub const VT_MESSAGE: flatbuffers::VOffsetT = 6;
1748        pub const VT_RESPONSES: flatbuffers::VOffsetT = 8;
1749
1750        #[inline]
1751        pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
1752            RequestUserInput { _tab: table }
1753        }
1754        #[allow(unused_mut)]
1755        pub fn create<
1756            'bldr: 'args,
1757            'args: 'mut_bldr,
1758            'mut_bldr,
1759            A: flatbuffers::Allocator + 'bldr,
1760        >(
1761            _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
1762            args: &'args RequestUserInputArgs<'args>,
1763        ) -> flatbuffers::WIPOffset<RequestUserInput<'bldr>> {
1764            let mut builder = RequestUserInputBuilder::new(_fbb);
1765            if let Some(x) = args.responses {
1766                builder.add_responses(x);
1767            }
1768            if let Some(x) = args.message {
1769                builder.add_message(x);
1770            }
1771            builder.add_request_id(args.request_id);
1772            builder.finish()
1773        }
1774
1775        #[inline]
1776        pub fn request_id(&self) -> u32 {
1777            // Safety:
1778            // Created from valid Table for this object
1779            // which contains a valid value in this slot
1780            unsafe {
1781                self._tab
1782                    .get::<u32>(RequestUserInput::VT_REQUEST_ID, Some(0))
1783                    .unwrap()
1784            }
1785        }
1786        #[inline]
1787        pub fn message(&self) -> Option<flatbuffers::Vector<'a, u8>> {
1788            // Safety:
1789            // Created from valid Table for this object
1790            // which contains a valid value in this slot
1791            unsafe {
1792                self._tab
1793                    .get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, u8>>>(
1794                        RequestUserInput::VT_MESSAGE,
1795                        None,
1796                    )
1797            }
1798        }
1799        #[inline]
1800        pub fn responses(
1801            &self,
1802        ) -> flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<ClientResponse<'a>>> {
1803            // Safety:
1804            // Created from valid Table for this object
1805            // which contains a valid value in this slot
1806            unsafe {
1807                self._tab
1808                    .get::<flatbuffers::ForwardsUOffset<
1809                        flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<ClientResponse>>,
1810                    >>(RequestUserInput::VT_RESPONSES, None)
1811                    .unwrap()
1812            }
1813        }
1814    }
1815
1816    impl flatbuffers::Verifiable for RequestUserInput<'_> {
1817        #[inline]
1818        fn run_verifier(
1819            v: &mut flatbuffers::Verifier,
1820            pos: usize,
1821        ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
1822            use self::flatbuffers::Verifiable;
1823            v.visit_table(pos)?
1824                .visit_field::<u32>("request_id", Self::VT_REQUEST_ID, false)?
1825                .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, u8>>>(
1826                    "message",
1827                    Self::VT_MESSAGE,
1828                    false,
1829                )?
1830                .visit_field::<flatbuffers::ForwardsUOffset<
1831                    flatbuffers::Vector<'_, flatbuffers::ForwardsUOffset<ClientResponse>>,
1832                >>("responses", Self::VT_RESPONSES, true)?
1833                .finish();
1834            Ok(())
1835        }
1836    }
1837    pub struct RequestUserInputArgs<'a> {
1838        pub request_id: u32,
1839        pub message: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, u8>>>,
1840        pub responses: Option<
1841            flatbuffers::WIPOffset<
1842                flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<ClientResponse<'a>>>,
1843            >,
1844        >,
1845    }
1846    impl<'a> Default for RequestUserInputArgs<'a> {
1847        #[inline]
1848        fn default() -> Self {
1849            RequestUserInputArgs {
1850                request_id: 0,
1851                message: None,
1852                responses: None, // required field
1853            }
1854        }
1855    }
1856
1857    pub struct RequestUserInputBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
1858        fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
1859        start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
1860    }
1861    impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> RequestUserInputBuilder<'a, 'b, A> {
1862        #[inline]
1863        pub fn add_request_id(&mut self, request_id: u32) {
1864            self.fbb_
1865                .push_slot::<u32>(RequestUserInput::VT_REQUEST_ID, request_id, 0);
1866        }
1867        #[inline]
1868        pub fn add_message(
1869            &mut self,
1870            message: flatbuffers::WIPOffset<flatbuffers::Vector<'b, u8>>,
1871        ) {
1872            self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(
1873                RequestUserInput::VT_MESSAGE,
1874                message,
1875            );
1876        }
1877        #[inline]
1878        pub fn add_responses(
1879            &mut self,
1880            responses: flatbuffers::WIPOffset<
1881                flatbuffers::Vector<'b, flatbuffers::ForwardsUOffset<ClientResponse<'b>>>,
1882            >,
1883        ) {
1884            self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(
1885                RequestUserInput::VT_RESPONSES,
1886                responses,
1887            );
1888        }
1889        #[inline]
1890        pub fn new(
1891            _fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
1892        ) -> RequestUserInputBuilder<'a, 'b, A> {
1893            let start = _fbb.start_table();
1894            RequestUserInputBuilder {
1895                fbb_: _fbb,
1896                start_: start,
1897            }
1898        }
1899        #[inline]
1900        pub fn finish(self) -> flatbuffers::WIPOffset<RequestUserInput<'a>> {
1901            let o = self.fbb_.end_table(self.start_);
1902            self.fbb_
1903                .required(o, RequestUserInput::VT_RESPONSES, "responses");
1904            flatbuffers::WIPOffset::new(o.value())
1905        }
1906    }
1907
1908    impl core::fmt::Debug for RequestUserInput<'_> {
1909        fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
1910            let mut ds = f.debug_struct("RequestUserInput");
1911            ds.field("request_id", &self.request_id());
1912            ds.field("message", &self.message());
1913            ds.field("responses", &self.responses());
1914            ds.finish()
1915        }
1916    }
1917    pub enum ContextUpdatedOffset {}
1918    #[derive(Copy, Clone, PartialEq)]
1919
1920    pub struct ContextUpdated<'a> {
1921        pub _tab: flatbuffers::Table<'a>,
1922    }
1923
1924    impl<'a> flatbuffers::Follow<'a> for ContextUpdated<'a> {
1925        type Inner = ContextUpdated<'a>;
1926        #[inline]
1927        unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
1928            Self {
1929                _tab: flatbuffers::Table::new(buf, loc),
1930            }
1931        }
1932    }
1933
1934    impl<'a> ContextUpdated<'a> {
1935        pub const VT_CONTEXT: flatbuffers::VOffsetT = 4;
1936
1937        #[inline]
1938        pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
1939            ContextUpdated { _tab: table }
1940        }
1941        #[allow(unused_mut)]
1942        pub fn create<
1943            'bldr: 'args,
1944            'args: 'mut_bldr,
1945            'mut_bldr,
1946            A: flatbuffers::Allocator + 'bldr,
1947        >(
1948            _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
1949            args: &'args ContextUpdatedArgs<'args>,
1950        ) -> flatbuffers::WIPOffset<ContextUpdated<'bldr>> {
1951            let mut builder = ContextUpdatedBuilder::new(_fbb);
1952            if let Some(x) = args.context {
1953                builder.add_context(x);
1954            }
1955            builder.finish()
1956        }
1957
1958        #[inline]
1959        pub fn context(&self) -> flatbuffers::Vector<'a, u8> {
1960            // Safety:
1961            // Created from valid Table for this object
1962            // which contains a valid value in this slot
1963            unsafe {
1964                self._tab
1965                    .get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, u8>>>(
1966                        ContextUpdated::VT_CONTEXT,
1967                        None,
1968                    )
1969                    .unwrap()
1970            }
1971        }
1972    }
1973
1974    impl flatbuffers::Verifiable for ContextUpdated<'_> {
1975        #[inline]
1976        fn run_verifier(
1977            v: &mut flatbuffers::Verifier,
1978            pos: usize,
1979        ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
1980            use self::flatbuffers::Verifiable;
1981            v.visit_table(pos)?
1982                .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, u8>>>(
1983                    "context",
1984                    Self::VT_CONTEXT,
1985                    true,
1986                )?
1987                .finish();
1988            Ok(())
1989        }
1990    }
1991    pub struct ContextUpdatedArgs<'a> {
1992        pub context: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, u8>>>,
1993    }
1994    impl<'a> Default for ContextUpdatedArgs<'a> {
1995        #[inline]
1996        fn default() -> Self {
1997            ContextUpdatedArgs {
1998                context: None, // required field
1999            }
2000        }
2001    }
2002
2003    pub struct ContextUpdatedBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
2004        fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
2005        start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
2006    }
2007    impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> ContextUpdatedBuilder<'a, 'b, A> {
2008        #[inline]
2009        pub fn add_context(
2010            &mut self,
2011            context: flatbuffers::WIPOffset<flatbuffers::Vector<'b, u8>>,
2012        ) {
2013            self.fbb_
2014                .push_slot_always::<flatbuffers::WIPOffset<_>>(ContextUpdated::VT_CONTEXT, context);
2015        }
2016        #[inline]
2017        pub fn new(
2018            _fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
2019        ) -> ContextUpdatedBuilder<'a, 'b, A> {
2020            let start = _fbb.start_table();
2021            ContextUpdatedBuilder {
2022                fbb_: _fbb,
2023                start_: start,
2024            }
2025        }
2026        #[inline]
2027        pub fn finish(self) -> flatbuffers::WIPOffset<ContextUpdated<'a>> {
2028            let o = self.fbb_.end_table(self.start_);
2029            self.fbb_.required(o, ContextUpdated::VT_CONTEXT, "context");
2030            flatbuffers::WIPOffset::new(o.value())
2031        }
2032    }
2033
2034    impl core::fmt::Debug for ContextUpdated<'_> {
2035        fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
2036            let mut ds = f.debug_struct("ContextUpdated");
2037            ds.field("context", &self.context());
2038            ds.finish()
2039        }
2040    }
2041    pub enum SetSecretRequestOffset {}
2042    #[derive(Copy, Clone, PartialEq)]
2043
2044    pub struct SetSecretRequest<'a> {
2045        pub _tab: flatbuffers::Table<'a>,
2046    }
2047
2048    impl<'a> flatbuffers::Follow<'a> for SetSecretRequest<'a> {
2049        type Inner = SetSecretRequest<'a>;
2050        #[inline]
2051        unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
2052            Self {
2053                _tab: flatbuffers::Table::new(buf, loc),
2054            }
2055        }
2056    }
2057
2058    impl<'a> SetSecretRequest<'a> {
2059        pub const VT_KEY: flatbuffers::VOffsetT = 4;
2060        pub const VT_VALUE: flatbuffers::VOffsetT = 6;
2061
2062        #[inline]
2063        pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
2064            SetSecretRequest { _tab: table }
2065        }
2066        #[allow(unused_mut)]
2067        pub fn create<
2068            'bldr: 'args,
2069            'args: 'mut_bldr,
2070            'mut_bldr,
2071            A: flatbuffers::Allocator + 'bldr,
2072        >(
2073            _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
2074            args: &'args SetSecretRequestArgs<'args>,
2075        ) -> flatbuffers::WIPOffset<SetSecretRequest<'bldr>> {
2076            let mut builder = SetSecretRequestBuilder::new(_fbb);
2077            if let Some(x) = args.value {
2078                builder.add_value(x);
2079            }
2080            if let Some(x) = args.key {
2081                builder.add_key(x);
2082            }
2083            builder.finish()
2084        }
2085
2086        #[inline]
2087        pub fn key(&self) -> super::common::SecretsId<'a> {
2088            // Safety:
2089            // Created from valid Table for this object
2090            // which contains a valid value in this slot
2091            unsafe {
2092                self._tab
2093                    .get::<flatbuffers::ForwardsUOffset<super::common::SecretsId>>(
2094                        SetSecretRequest::VT_KEY,
2095                        None,
2096                    )
2097                    .unwrap()
2098            }
2099        }
2100        #[inline]
2101        pub fn value(&self) -> flatbuffers::Vector<'a, u8> {
2102            // Safety:
2103            // Created from valid Table for this object
2104            // which contains a valid value in this slot
2105            unsafe {
2106                self._tab
2107                    .get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, u8>>>(
2108                        SetSecretRequest::VT_VALUE,
2109                        None,
2110                    )
2111                    .unwrap()
2112            }
2113        }
2114    }
2115
2116    impl flatbuffers::Verifiable for SetSecretRequest<'_> {
2117        #[inline]
2118        fn run_verifier(
2119            v: &mut flatbuffers::Verifier,
2120            pos: usize,
2121        ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
2122            use self::flatbuffers::Verifiable;
2123            v.visit_table(pos)?
2124                .visit_field::<flatbuffers::ForwardsUOffset<super::common::SecretsId>>(
2125                    "key",
2126                    Self::VT_KEY,
2127                    true,
2128                )?
2129                .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, u8>>>(
2130                    "value",
2131                    Self::VT_VALUE,
2132                    true,
2133                )?
2134                .finish();
2135            Ok(())
2136        }
2137    }
2138    pub struct SetSecretRequestArgs<'a> {
2139        pub key: Option<flatbuffers::WIPOffset<super::common::SecretsId<'a>>>,
2140        pub value: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, u8>>>,
2141    }
2142    impl<'a> Default for SetSecretRequestArgs<'a> {
2143        #[inline]
2144        fn default() -> Self {
2145            SetSecretRequestArgs {
2146                key: None,   // required field
2147                value: None, // required field
2148            }
2149        }
2150    }
2151
2152    pub struct SetSecretRequestBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
2153        fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
2154        start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
2155    }
2156    impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> SetSecretRequestBuilder<'a, 'b, A> {
2157        #[inline]
2158        pub fn add_key(&mut self, key: flatbuffers::WIPOffset<super::common::SecretsId<'b>>) {
2159            self.fbb_
2160                .push_slot_always::<flatbuffers::WIPOffset<super::common::SecretsId>>(
2161                    SetSecretRequest::VT_KEY,
2162                    key,
2163                );
2164        }
2165        #[inline]
2166        pub fn add_value(&mut self, value: flatbuffers::WIPOffset<flatbuffers::Vector<'b, u8>>) {
2167            self.fbb_
2168                .push_slot_always::<flatbuffers::WIPOffset<_>>(SetSecretRequest::VT_VALUE, value);
2169        }
2170        #[inline]
2171        pub fn new(
2172            _fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
2173        ) -> SetSecretRequestBuilder<'a, 'b, A> {
2174            let start = _fbb.start_table();
2175            SetSecretRequestBuilder {
2176                fbb_: _fbb,
2177                start_: start,
2178            }
2179        }
2180        #[inline]
2181        pub fn finish(self) -> flatbuffers::WIPOffset<SetSecretRequest<'a>> {
2182            let o = self.fbb_.end_table(self.start_);
2183            self.fbb_.required(o, SetSecretRequest::VT_KEY, "key");
2184            self.fbb_.required(o, SetSecretRequest::VT_VALUE, "value");
2185            flatbuffers::WIPOffset::new(o.value())
2186        }
2187    }
2188
2189    impl core::fmt::Debug for SetSecretRequest<'_> {
2190        fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
2191            let mut ds = f.debug_struct("SetSecretRequest");
2192            ds.field("key", &self.key());
2193            ds.field("value", &self.value());
2194            ds.finish()
2195        }
2196    }
2197    pub enum OutboundDelegateMsgOffset {}
2198    #[derive(Copy, Clone, PartialEq)]
2199
2200    pub struct OutboundDelegateMsg<'a> {
2201        pub _tab: flatbuffers::Table<'a>,
2202    }
2203
2204    impl<'a> flatbuffers::Follow<'a> for OutboundDelegateMsg<'a> {
2205        type Inner = OutboundDelegateMsg<'a>;
2206        #[inline]
2207        unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
2208            Self {
2209                _tab: flatbuffers::Table::new(buf, loc),
2210            }
2211        }
2212    }
2213
2214    impl<'a> OutboundDelegateMsg<'a> {
2215        pub const VT_INBOUND_TYPE: flatbuffers::VOffsetT = 4;
2216        pub const VT_INBOUND: flatbuffers::VOffsetT = 6;
2217
2218        #[inline]
2219        pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
2220            OutboundDelegateMsg { _tab: table }
2221        }
2222        #[allow(unused_mut)]
2223        pub fn create<
2224            'bldr: 'args,
2225            'args: 'mut_bldr,
2226            'mut_bldr,
2227            A: flatbuffers::Allocator + 'bldr,
2228        >(
2229            _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
2230            args: &'args OutboundDelegateMsgArgs,
2231        ) -> flatbuffers::WIPOffset<OutboundDelegateMsg<'bldr>> {
2232            let mut builder = OutboundDelegateMsgBuilder::new(_fbb);
2233            if let Some(x) = args.inbound {
2234                builder.add_inbound(x);
2235            }
2236            builder.add_inbound_type(args.inbound_type);
2237            builder.finish()
2238        }
2239
2240        #[inline]
2241        pub fn inbound_type(&self) -> OutboundDelegateMsgType {
2242            // Safety:
2243            // Created from valid Table for this object
2244            // which contains a valid value in this slot
2245            unsafe {
2246                self._tab
2247                    .get::<OutboundDelegateMsgType>(
2248                        OutboundDelegateMsg::VT_INBOUND_TYPE,
2249                        Some(OutboundDelegateMsgType::NONE),
2250                    )
2251                    .unwrap()
2252            }
2253        }
2254        #[inline]
2255        pub fn inbound(&self) -> flatbuffers::Table<'a> {
2256            // Safety:
2257            // Created from valid Table for this object
2258            // which contains a valid value in this slot
2259            unsafe {
2260                self._tab
2261                    .get::<flatbuffers::ForwardsUOffset<flatbuffers::Table<'a>>>(
2262                        OutboundDelegateMsg::VT_INBOUND,
2263                        None,
2264                    )
2265                    .unwrap()
2266            }
2267        }
2268        #[inline]
2269        #[allow(non_snake_case)]
2270        pub fn inbound_as_common_application_message(
2271            &self,
2272        ) -> Option<super::common::ApplicationMessage<'a>> {
2273            if self.inbound_type() == OutboundDelegateMsgType::common_ApplicationMessage {
2274                let u = self.inbound();
2275                // Safety:
2276                // Created from a valid Table for this object
2277                // Which contains a valid union in this slot
2278                Some(unsafe { super::common::ApplicationMessage::init_from_table(u) })
2279            } else {
2280                None
2281            }
2282        }
2283
2284        #[inline]
2285        #[allow(non_snake_case)]
2286        pub fn inbound_as_request_user_input(&self) -> Option<RequestUserInput<'a>> {
2287            if self.inbound_type() == OutboundDelegateMsgType::RequestUserInput {
2288                let u = self.inbound();
2289                // Safety:
2290                // Created from a valid Table for this object
2291                // Which contains a valid union in this slot
2292                Some(unsafe { RequestUserInput::init_from_table(u) })
2293            } else {
2294                None
2295            }
2296        }
2297
2298        #[inline]
2299        #[allow(non_snake_case)]
2300        pub fn inbound_as_context_updated(&self) -> Option<ContextUpdated<'a>> {
2301            if self.inbound_type() == OutboundDelegateMsgType::ContextUpdated {
2302                let u = self.inbound();
2303                // Safety:
2304                // Created from a valid Table for this object
2305                // Which contains a valid union in this slot
2306                Some(unsafe { ContextUpdated::init_from_table(u) })
2307            } else {
2308                None
2309            }
2310        }
2311
2312        #[inline]
2313        #[allow(non_snake_case)]
2314        pub fn inbound_as_common_get_secret_request(
2315            &self,
2316        ) -> Option<super::common::GetSecretRequest<'a>> {
2317            if self.inbound_type() == OutboundDelegateMsgType::common_GetSecretRequest {
2318                let u = self.inbound();
2319                // Safety:
2320                // Created from a valid Table for this object
2321                // Which contains a valid union in this slot
2322                Some(unsafe { super::common::GetSecretRequest::init_from_table(u) })
2323            } else {
2324                None
2325            }
2326        }
2327
2328        #[inline]
2329        #[allow(non_snake_case)]
2330        pub fn inbound_as_set_secret_request(&self) -> Option<SetSecretRequest<'a>> {
2331            if self.inbound_type() == OutboundDelegateMsgType::SetSecretRequest {
2332                let u = self.inbound();
2333                // Safety:
2334                // Created from a valid Table for this object
2335                // Which contains a valid union in this slot
2336                Some(unsafe { SetSecretRequest::init_from_table(u) })
2337            } else {
2338                None
2339            }
2340        }
2341
2342        #[inline]
2343        #[allow(non_snake_case)]
2344        pub fn inbound_as_common_get_secret_response(
2345            &self,
2346        ) -> Option<super::common::GetSecretResponse<'a>> {
2347            if self.inbound_type() == OutboundDelegateMsgType::common_GetSecretResponse {
2348                let u = self.inbound();
2349                // Safety:
2350                // Created from a valid Table for this object
2351                // Which contains a valid union in this slot
2352                Some(unsafe { super::common::GetSecretResponse::init_from_table(u) })
2353            } else {
2354                None
2355            }
2356        }
2357    }
2358
2359    impl flatbuffers::Verifiable for OutboundDelegateMsg<'_> {
2360        #[inline]
2361        fn run_verifier(
2362            v: &mut flatbuffers::Verifier,
2363            pos: usize,
2364        ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
2365            use self::flatbuffers::Verifiable;
2366            v.visit_table(pos)?
2367     .visit_union::<OutboundDelegateMsgType, _>("inbound_type", Self::VT_INBOUND_TYPE, "inbound", Self::VT_INBOUND, true, |key, v, pos| {
2368        match key {
2369          OutboundDelegateMsgType::common_ApplicationMessage => v.verify_union_variant::<flatbuffers::ForwardsUOffset<super::common::ApplicationMessage>>("OutboundDelegateMsgType::common_ApplicationMessage", pos),
2370          OutboundDelegateMsgType::RequestUserInput => v.verify_union_variant::<flatbuffers::ForwardsUOffset<RequestUserInput>>("OutboundDelegateMsgType::RequestUserInput", pos),
2371          OutboundDelegateMsgType::ContextUpdated => v.verify_union_variant::<flatbuffers::ForwardsUOffset<ContextUpdated>>("OutboundDelegateMsgType::ContextUpdated", pos),
2372          OutboundDelegateMsgType::common_GetSecretRequest => v.verify_union_variant::<flatbuffers::ForwardsUOffset<super::common::GetSecretRequest>>("OutboundDelegateMsgType::common_GetSecretRequest", pos),
2373          OutboundDelegateMsgType::SetSecretRequest => v.verify_union_variant::<flatbuffers::ForwardsUOffset<SetSecretRequest>>("OutboundDelegateMsgType::SetSecretRequest", pos),
2374          OutboundDelegateMsgType::common_GetSecretResponse => v.verify_union_variant::<flatbuffers::ForwardsUOffset<super::common::GetSecretResponse>>("OutboundDelegateMsgType::common_GetSecretResponse", pos),
2375          _ => Ok(()),
2376        }
2377     })?
2378     .finish();
2379            Ok(())
2380        }
2381    }
2382    pub struct OutboundDelegateMsgArgs {
2383        pub inbound_type: OutboundDelegateMsgType,
2384        pub inbound: Option<flatbuffers::WIPOffset<flatbuffers::UnionWIPOffset>>,
2385    }
2386    impl<'a> Default for OutboundDelegateMsgArgs {
2387        #[inline]
2388        fn default() -> Self {
2389            OutboundDelegateMsgArgs {
2390                inbound_type: OutboundDelegateMsgType::NONE,
2391                inbound: None, // required field
2392            }
2393        }
2394    }
2395
2396    pub struct OutboundDelegateMsgBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
2397        fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
2398        start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
2399    }
2400    impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> OutboundDelegateMsgBuilder<'a, 'b, A> {
2401        #[inline]
2402        pub fn add_inbound_type(&mut self, inbound_type: OutboundDelegateMsgType) {
2403            self.fbb_.push_slot::<OutboundDelegateMsgType>(
2404                OutboundDelegateMsg::VT_INBOUND_TYPE,
2405                inbound_type,
2406                OutboundDelegateMsgType::NONE,
2407            );
2408        }
2409        #[inline]
2410        pub fn add_inbound(
2411            &mut self,
2412            inbound: flatbuffers::WIPOffset<flatbuffers::UnionWIPOffset>,
2413        ) {
2414            self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(
2415                OutboundDelegateMsg::VT_INBOUND,
2416                inbound,
2417            );
2418        }
2419        #[inline]
2420        pub fn new(
2421            _fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
2422        ) -> OutboundDelegateMsgBuilder<'a, 'b, A> {
2423            let start = _fbb.start_table();
2424            OutboundDelegateMsgBuilder {
2425                fbb_: _fbb,
2426                start_: start,
2427            }
2428        }
2429        #[inline]
2430        pub fn finish(self) -> flatbuffers::WIPOffset<OutboundDelegateMsg<'a>> {
2431            let o = self.fbb_.end_table(self.start_);
2432            self.fbb_
2433                .required(o, OutboundDelegateMsg::VT_INBOUND, "inbound");
2434            flatbuffers::WIPOffset::new(o.value())
2435        }
2436    }
2437
2438    impl core::fmt::Debug for OutboundDelegateMsg<'_> {
2439        fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
2440            let mut ds = f.debug_struct("OutboundDelegateMsg");
2441            ds.field("inbound_type", &self.inbound_type());
2442            match self.inbound_type() {
2443                OutboundDelegateMsgType::common_ApplicationMessage => {
2444                    if let Some(x) = self.inbound_as_common_application_message() {
2445                        ds.field("inbound", &x)
2446                    } else {
2447                        ds.field(
2448                            "inbound",
2449                            &"InvalidFlatbuffer: Union discriminant does not match value.",
2450                        )
2451                    }
2452                }
2453                OutboundDelegateMsgType::RequestUserInput => {
2454                    if let Some(x) = self.inbound_as_request_user_input() {
2455                        ds.field("inbound", &x)
2456                    } else {
2457                        ds.field(
2458                            "inbound",
2459                            &"InvalidFlatbuffer: Union discriminant does not match value.",
2460                        )
2461                    }
2462                }
2463                OutboundDelegateMsgType::ContextUpdated => {
2464                    if let Some(x) = self.inbound_as_context_updated() {
2465                        ds.field("inbound", &x)
2466                    } else {
2467                        ds.field(
2468                            "inbound",
2469                            &"InvalidFlatbuffer: Union discriminant does not match value.",
2470                        )
2471                    }
2472                }
2473                OutboundDelegateMsgType::common_GetSecretRequest => {
2474                    if let Some(x) = self.inbound_as_common_get_secret_request() {
2475                        ds.field("inbound", &x)
2476                    } else {
2477                        ds.field(
2478                            "inbound",
2479                            &"InvalidFlatbuffer: Union discriminant does not match value.",
2480                        )
2481                    }
2482                }
2483                OutboundDelegateMsgType::SetSecretRequest => {
2484                    if let Some(x) = self.inbound_as_set_secret_request() {
2485                        ds.field("inbound", &x)
2486                    } else {
2487                        ds.field(
2488                            "inbound",
2489                            &"InvalidFlatbuffer: Union discriminant does not match value.",
2490                        )
2491                    }
2492                }
2493                OutboundDelegateMsgType::common_GetSecretResponse => {
2494                    if let Some(x) = self.inbound_as_common_get_secret_response() {
2495                        ds.field("inbound", &x)
2496                    } else {
2497                        ds.field(
2498                            "inbound",
2499                            &"InvalidFlatbuffer: Union discriminant does not match value.",
2500                        )
2501                    }
2502                }
2503                _ => {
2504                    let x: Option<()> = None;
2505                    ds.field("inbound", &x)
2506                }
2507            };
2508            ds.finish()
2509        }
2510    }
2511    pub enum DelegateResponseOffset {}
2512    #[derive(Copy, Clone, PartialEq)]
2513
2514    pub struct DelegateResponse<'a> {
2515        pub _tab: flatbuffers::Table<'a>,
2516    }
2517
2518    impl<'a> flatbuffers::Follow<'a> for DelegateResponse<'a> {
2519        type Inner = DelegateResponse<'a>;
2520        #[inline]
2521        unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
2522            Self {
2523                _tab: flatbuffers::Table::new(buf, loc),
2524            }
2525        }
2526    }
2527
2528    impl<'a> DelegateResponse<'a> {
2529        pub const VT_KEY: flatbuffers::VOffsetT = 4;
2530        pub const VT_VALUES: flatbuffers::VOffsetT = 6;
2531
2532        #[inline]
2533        pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
2534            DelegateResponse { _tab: table }
2535        }
2536        #[allow(unused_mut)]
2537        pub fn create<
2538            'bldr: 'args,
2539            'args: 'mut_bldr,
2540            'mut_bldr,
2541            A: flatbuffers::Allocator + 'bldr,
2542        >(
2543            _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
2544            args: &'args DelegateResponseArgs<'args>,
2545        ) -> flatbuffers::WIPOffset<DelegateResponse<'bldr>> {
2546            let mut builder = DelegateResponseBuilder::new(_fbb);
2547            if let Some(x) = args.values {
2548                builder.add_values(x);
2549            }
2550            if let Some(x) = args.key {
2551                builder.add_key(x);
2552            }
2553            builder.finish()
2554        }
2555
2556        #[inline]
2557        pub fn key(&self) -> DelegateKey<'a> {
2558            // Safety:
2559            // Created from valid Table for this object
2560            // which contains a valid value in this slot
2561            unsafe {
2562                self._tab
2563                    .get::<flatbuffers::ForwardsUOffset<DelegateKey>>(
2564                        DelegateResponse::VT_KEY,
2565                        None,
2566                    )
2567                    .unwrap()
2568            }
2569        }
2570        #[inline]
2571        pub fn values(
2572            &self,
2573        ) -> flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<OutboundDelegateMsg<'a>>>
2574        {
2575            // Safety:
2576            // Created from valid Table for this object
2577            // which contains a valid value in this slot
2578            unsafe {
2579                self._tab
2580                    .get::<flatbuffers::ForwardsUOffset<
2581                        flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<OutboundDelegateMsg>>,
2582                    >>(DelegateResponse::VT_VALUES, None)
2583                    .unwrap()
2584            }
2585        }
2586    }
2587
2588    impl flatbuffers::Verifiable for DelegateResponse<'_> {
2589        #[inline]
2590        fn run_verifier(
2591            v: &mut flatbuffers::Verifier,
2592            pos: usize,
2593        ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
2594            use self::flatbuffers::Verifiable;
2595            v.visit_table(pos)?
2596                .visit_field::<flatbuffers::ForwardsUOffset<DelegateKey>>(
2597                    "key",
2598                    Self::VT_KEY,
2599                    true,
2600                )?
2601                .visit_field::<flatbuffers::ForwardsUOffset<
2602                    flatbuffers::Vector<'_, flatbuffers::ForwardsUOffset<OutboundDelegateMsg>>,
2603                >>("values", Self::VT_VALUES, true)?
2604                .finish();
2605            Ok(())
2606        }
2607    }
2608    pub struct DelegateResponseArgs<'a> {
2609        pub key: Option<flatbuffers::WIPOffset<DelegateKey<'a>>>,
2610        pub values: Option<
2611            flatbuffers::WIPOffset<
2612                flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<OutboundDelegateMsg<'a>>>,
2613            >,
2614        >,
2615    }
2616    impl<'a> Default for DelegateResponseArgs<'a> {
2617        #[inline]
2618        fn default() -> Self {
2619            DelegateResponseArgs {
2620                key: None,    // required field
2621                values: None, // required field
2622            }
2623        }
2624    }
2625
2626    pub struct DelegateResponseBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
2627        fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
2628        start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
2629    }
2630    impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> DelegateResponseBuilder<'a, 'b, A> {
2631        #[inline]
2632        pub fn add_key(&mut self, key: flatbuffers::WIPOffset<DelegateKey<'b>>) {
2633            self.fbb_
2634                .push_slot_always::<flatbuffers::WIPOffset<DelegateKey>>(
2635                    DelegateResponse::VT_KEY,
2636                    key,
2637                );
2638        }
2639        #[inline]
2640        pub fn add_values(
2641            &mut self,
2642            values: flatbuffers::WIPOffset<
2643                flatbuffers::Vector<'b, flatbuffers::ForwardsUOffset<OutboundDelegateMsg<'b>>>,
2644            >,
2645        ) {
2646            self.fbb_
2647                .push_slot_always::<flatbuffers::WIPOffset<_>>(DelegateResponse::VT_VALUES, values);
2648        }
2649        #[inline]
2650        pub fn new(
2651            _fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
2652        ) -> DelegateResponseBuilder<'a, 'b, A> {
2653            let start = _fbb.start_table();
2654            DelegateResponseBuilder {
2655                fbb_: _fbb,
2656                start_: start,
2657            }
2658        }
2659        #[inline]
2660        pub fn finish(self) -> flatbuffers::WIPOffset<DelegateResponse<'a>> {
2661            let o = self.fbb_.end_table(self.start_);
2662            self.fbb_.required(o, DelegateResponse::VT_KEY, "key");
2663            self.fbb_.required(o, DelegateResponse::VT_VALUES, "values");
2664            flatbuffers::WIPOffset::new(o.value())
2665        }
2666    }
2667
2668    impl core::fmt::Debug for DelegateResponse<'_> {
2669        fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
2670            let mut ds = f.debug_struct("DelegateResponse");
2671            ds.field("key", &self.key());
2672            ds.field("values", &self.values());
2673            ds.finish()
2674        }
2675    }
2676    pub enum GenerateRandDataOffset {}
2677    #[derive(Copy, Clone, PartialEq)]
2678
2679    pub struct GenerateRandData<'a> {
2680        pub _tab: flatbuffers::Table<'a>,
2681    }
2682
2683    impl<'a> flatbuffers::Follow<'a> for GenerateRandData<'a> {
2684        type Inner = GenerateRandData<'a>;
2685        #[inline]
2686        unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
2687            Self {
2688                _tab: flatbuffers::Table::new(buf, loc),
2689            }
2690        }
2691    }
2692
2693    impl<'a> GenerateRandData<'a> {
2694        pub const VT_WRAPPED_STATE: flatbuffers::VOffsetT = 4;
2695
2696        #[inline]
2697        pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
2698            GenerateRandData { _tab: table }
2699        }
2700        #[allow(unused_mut)]
2701        pub fn create<
2702            'bldr: 'args,
2703            'args: 'mut_bldr,
2704            'mut_bldr,
2705            A: flatbuffers::Allocator + 'bldr,
2706        >(
2707            _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
2708            args: &'args GenerateRandDataArgs<'args>,
2709        ) -> flatbuffers::WIPOffset<GenerateRandData<'bldr>> {
2710            let mut builder = GenerateRandDataBuilder::new(_fbb);
2711            if let Some(x) = args.wrapped_state {
2712                builder.add_wrapped_state(x);
2713            }
2714            builder.finish()
2715        }
2716
2717        #[inline]
2718        pub fn wrapped_state(&self) -> flatbuffers::Vector<'a, u8> {
2719            // Safety:
2720            // Created from valid Table for this object
2721            // which contains a valid value in this slot
2722            unsafe {
2723                self._tab
2724                    .get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, u8>>>(
2725                        GenerateRandData::VT_WRAPPED_STATE,
2726                        None,
2727                    )
2728                    .unwrap()
2729            }
2730        }
2731    }
2732
2733    impl flatbuffers::Verifiable for GenerateRandData<'_> {
2734        #[inline]
2735        fn run_verifier(
2736            v: &mut flatbuffers::Verifier,
2737            pos: usize,
2738        ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
2739            use self::flatbuffers::Verifiable;
2740            v.visit_table(pos)?
2741                .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, u8>>>(
2742                    "wrapped_state",
2743                    Self::VT_WRAPPED_STATE,
2744                    true,
2745                )?
2746                .finish();
2747            Ok(())
2748        }
2749    }
2750    pub struct GenerateRandDataArgs<'a> {
2751        pub wrapped_state: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, u8>>>,
2752    }
2753    impl<'a> Default for GenerateRandDataArgs<'a> {
2754        #[inline]
2755        fn default() -> Self {
2756            GenerateRandDataArgs {
2757                wrapped_state: None, // required field
2758            }
2759        }
2760    }
2761
2762    pub struct GenerateRandDataBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
2763        fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
2764        start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
2765    }
2766    impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> GenerateRandDataBuilder<'a, 'b, A> {
2767        #[inline]
2768        pub fn add_wrapped_state(
2769            &mut self,
2770            wrapped_state: flatbuffers::WIPOffset<flatbuffers::Vector<'b, u8>>,
2771        ) {
2772            self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(
2773                GenerateRandData::VT_WRAPPED_STATE,
2774                wrapped_state,
2775            );
2776        }
2777        #[inline]
2778        pub fn new(
2779            _fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
2780        ) -> GenerateRandDataBuilder<'a, 'b, A> {
2781            let start = _fbb.start_table();
2782            GenerateRandDataBuilder {
2783                fbb_: _fbb,
2784                start_: start,
2785            }
2786        }
2787        #[inline]
2788        pub fn finish(self) -> flatbuffers::WIPOffset<GenerateRandData<'a>> {
2789            let o = self.fbb_.end_table(self.start_);
2790            self.fbb_
2791                .required(o, GenerateRandData::VT_WRAPPED_STATE, "wrapped_state");
2792            flatbuffers::WIPOffset::new(o.value())
2793        }
2794    }
2795
2796    impl core::fmt::Debug for GenerateRandData<'_> {
2797        fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
2798            let mut ds = f.debug_struct("GenerateRandData");
2799            ds.field("wrapped_state", &self.wrapped_state());
2800            ds.finish()
2801        }
2802    }
2803    pub enum OkOffset {}
2804    #[derive(Copy, Clone, PartialEq)]
2805
2806    pub struct Ok<'a> {
2807        pub _tab: flatbuffers::Table<'a>,
2808    }
2809
2810    impl<'a> flatbuffers::Follow<'a> for Ok<'a> {
2811        type Inner = Ok<'a>;
2812        #[inline]
2813        unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
2814            Self {
2815                _tab: flatbuffers::Table::new(buf, loc),
2816            }
2817        }
2818    }
2819
2820    impl<'a> Ok<'a> {
2821        pub const VT_MSG: flatbuffers::VOffsetT = 4;
2822
2823        #[inline]
2824        pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
2825            Ok { _tab: table }
2826        }
2827        #[allow(unused_mut)]
2828        pub fn create<
2829            'bldr: 'args,
2830            'args: 'mut_bldr,
2831            'mut_bldr,
2832            A: flatbuffers::Allocator + 'bldr,
2833        >(
2834            _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
2835            args: &'args OkArgs<'args>,
2836        ) -> flatbuffers::WIPOffset<Ok<'bldr>> {
2837            let mut builder = OkBuilder::new(_fbb);
2838            if let Some(x) = args.msg {
2839                builder.add_msg(x);
2840            }
2841            builder.finish()
2842        }
2843
2844        #[inline]
2845        pub fn msg(&self) -> &'a str {
2846            // Safety:
2847            // Created from valid Table for this object
2848            // which contains a valid value in this slot
2849            unsafe {
2850                self._tab
2851                    .get::<flatbuffers::ForwardsUOffset<&str>>(Ok::VT_MSG, None)
2852                    .unwrap()
2853            }
2854        }
2855    }
2856
2857    impl flatbuffers::Verifiable for Ok<'_> {
2858        #[inline]
2859        fn run_verifier(
2860            v: &mut flatbuffers::Verifier,
2861            pos: usize,
2862        ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
2863            use self::flatbuffers::Verifiable;
2864            v.visit_table(pos)?
2865                .visit_field::<flatbuffers::ForwardsUOffset<&str>>("msg", Self::VT_MSG, true)?
2866                .finish();
2867            Ok(())
2868        }
2869    }
2870    pub struct OkArgs<'a> {
2871        pub msg: Option<flatbuffers::WIPOffset<&'a str>>,
2872    }
2873    impl<'a> Default for OkArgs<'a> {
2874        #[inline]
2875        fn default() -> Self {
2876            OkArgs {
2877                msg: None, // required field
2878            }
2879        }
2880    }
2881
2882    pub struct OkBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
2883        fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
2884        start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
2885    }
2886    impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> OkBuilder<'a, 'b, A> {
2887        #[inline]
2888        pub fn add_msg(&mut self, msg: flatbuffers::WIPOffset<&'b str>) {
2889            self.fbb_
2890                .push_slot_always::<flatbuffers::WIPOffset<_>>(Ok::VT_MSG, msg);
2891        }
2892        #[inline]
2893        pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> OkBuilder<'a, 'b, A> {
2894            let start = _fbb.start_table();
2895            OkBuilder {
2896                fbb_: _fbb,
2897                start_: start,
2898            }
2899        }
2900        #[inline]
2901        pub fn finish(self) -> flatbuffers::WIPOffset<Ok<'a>> {
2902            let o = self.fbb_.end_table(self.start_);
2903            self.fbb_.required(o, Ok::VT_MSG, "msg");
2904            flatbuffers::WIPOffset::new(o.value())
2905        }
2906    }
2907
2908    impl core::fmt::Debug for Ok<'_> {
2909        fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
2910            let mut ds = f.debug_struct("Ok");
2911            ds.field("msg", &self.msg());
2912            ds.finish()
2913        }
2914    }
2915    pub enum ErrorOffset {}
2916    #[derive(Copy, Clone, PartialEq)]
2917
2918    pub struct Error<'a> {
2919        pub _tab: flatbuffers::Table<'a>,
2920    }
2921
2922    impl<'a> flatbuffers::Follow<'a> for Error<'a> {
2923        type Inner = Error<'a>;
2924        #[inline]
2925        unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
2926            Self {
2927                _tab: flatbuffers::Table::new(buf, loc),
2928            }
2929        }
2930    }
2931
2932    impl<'a> Error<'a> {
2933        pub const VT_MSG: flatbuffers::VOffsetT = 4;
2934
2935        #[inline]
2936        pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
2937            Error { _tab: table }
2938        }
2939        #[allow(unused_mut)]
2940        pub fn create<
2941            'bldr: 'args,
2942            'args: 'mut_bldr,
2943            'mut_bldr,
2944            A: flatbuffers::Allocator + 'bldr,
2945        >(
2946            _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
2947            args: &'args ErrorArgs<'args>,
2948        ) -> flatbuffers::WIPOffset<Error<'bldr>> {
2949            let mut builder = ErrorBuilder::new(_fbb);
2950            if let Some(x) = args.msg {
2951                builder.add_msg(x);
2952            }
2953            builder.finish()
2954        }
2955
2956        #[inline]
2957        pub fn msg(&self) -> &'a str {
2958            // Safety:
2959            // Created from valid Table for this object
2960            // which contains a valid value in this slot
2961            unsafe {
2962                self._tab
2963                    .get::<flatbuffers::ForwardsUOffset<&str>>(Error::VT_MSG, None)
2964                    .unwrap()
2965            }
2966        }
2967    }
2968
2969    impl flatbuffers::Verifiable for Error<'_> {
2970        #[inline]
2971        fn run_verifier(
2972            v: &mut flatbuffers::Verifier,
2973            pos: usize,
2974        ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
2975            use self::flatbuffers::Verifiable;
2976            v.visit_table(pos)?
2977                .visit_field::<flatbuffers::ForwardsUOffset<&str>>("msg", Self::VT_MSG, true)?
2978                .finish();
2979            Ok(())
2980        }
2981    }
2982    pub struct ErrorArgs<'a> {
2983        pub msg: Option<flatbuffers::WIPOffset<&'a str>>,
2984    }
2985    impl<'a> Default for ErrorArgs<'a> {
2986        #[inline]
2987        fn default() -> Self {
2988            ErrorArgs {
2989                msg: None, // required field
2990            }
2991        }
2992    }
2993
2994    pub struct ErrorBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
2995        fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
2996        start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
2997    }
2998    impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> ErrorBuilder<'a, 'b, A> {
2999        #[inline]
3000        pub fn add_msg(&mut self, msg: flatbuffers::WIPOffset<&'b str>) {
3001            self.fbb_
3002                .push_slot_always::<flatbuffers::WIPOffset<_>>(Error::VT_MSG, msg);
3003        }
3004        #[inline]
3005        pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> ErrorBuilder<'a, 'b, A> {
3006            let start = _fbb.start_table();
3007            ErrorBuilder {
3008                fbb_: _fbb,
3009                start_: start,
3010            }
3011        }
3012        #[inline]
3013        pub fn finish(self) -> flatbuffers::WIPOffset<Error<'a>> {
3014            let o = self.fbb_.end_table(self.start_);
3015            self.fbb_.required(o, Error::VT_MSG, "msg");
3016            flatbuffers::WIPOffset::new(o.value())
3017        }
3018    }
3019
3020    impl core::fmt::Debug for Error<'_> {
3021        fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
3022            let mut ds = f.debug_struct("Error");
3023            ds.field("msg", &self.msg());
3024            ds.finish()
3025        }
3026    }
3027    pub enum HostResponseOffset {}
3028    #[derive(Copy, Clone, PartialEq)]
3029
3030    pub struct HostResponse<'a> {
3031        pub _tab: flatbuffers::Table<'a>,
3032    }
3033
3034    impl<'a> flatbuffers::Follow<'a> for HostResponse<'a> {
3035        type Inner = HostResponse<'a>;
3036        #[inline]
3037        unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
3038            Self {
3039                _tab: flatbuffers::Table::new(buf, loc),
3040            }
3041        }
3042    }
3043
3044    impl<'a> HostResponse<'a> {
3045        pub const VT_RESPONSE_TYPE: flatbuffers::VOffsetT = 4;
3046        pub const VT_RESPONSE: flatbuffers::VOffsetT = 6;
3047
3048        #[inline]
3049        pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
3050            HostResponse { _tab: table }
3051        }
3052        #[allow(unused_mut)]
3053        pub fn create<
3054            'bldr: 'args,
3055            'args: 'mut_bldr,
3056            'mut_bldr,
3057            A: flatbuffers::Allocator + 'bldr,
3058        >(
3059            _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
3060            args: &'args HostResponseArgs,
3061        ) -> flatbuffers::WIPOffset<HostResponse<'bldr>> {
3062            let mut builder = HostResponseBuilder::new(_fbb);
3063            if let Some(x) = args.response {
3064                builder.add_response(x);
3065            }
3066            builder.add_response_type(args.response_type);
3067            builder.finish()
3068        }
3069
3070        #[inline]
3071        pub fn response_type(&self) -> HostResponseType {
3072            // Safety:
3073            // Created from valid Table for this object
3074            // which contains a valid value in this slot
3075            unsafe {
3076                self._tab
3077                    .get::<HostResponseType>(
3078                        HostResponse::VT_RESPONSE_TYPE,
3079                        Some(HostResponseType::NONE),
3080                    )
3081                    .unwrap()
3082            }
3083        }
3084        #[inline]
3085        pub fn response(&self) -> flatbuffers::Table<'a> {
3086            // Safety:
3087            // Created from valid Table for this object
3088            // which contains a valid value in this slot
3089            unsafe {
3090                self._tab
3091                    .get::<flatbuffers::ForwardsUOffset<flatbuffers::Table<'a>>>(
3092                        HostResponse::VT_RESPONSE,
3093                        None,
3094                    )
3095                    .unwrap()
3096            }
3097        }
3098        #[inline]
3099        #[allow(non_snake_case)]
3100        pub fn response_as_contract_response(&self) -> Option<ContractResponse<'a>> {
3101            if self.response_type() == HostResponseType::ContractResponse {
3102                let u = self.response();
3103                // Safety:
3104                // Created from a valid Table for this object
3105                // Which contains a valid union in this slot
3106                Some(unsafe { ContractResponse::init_from_table(u) })
3107            } else {
3108                None
3109            }
3110        }
3111
3112        #[inline]
3113        #[allow(non_snake_case)]
3114        pub fn response_as_delegate_response(&self) -> Option<DelegateResponse<'a>> {
3115            if self.response_type() == HostResponseType::DelegateResponse {
3116                let u = self.response();
3117                // Safety:
3118                // Created from a valid Table for this object
3119                // Which contains a valid union in this slot
3120                Some(unsafe { DelegateResponse::init_from_table(u) })
3121            } else {
3122                None
3123            }
3124        }
3125
3126        #[inline]
3127        #[allow(non_snake_case)]
3128        pub fn response_as_generate_rand_data(&self) -> Option<GenerateRandData<'a>> {
3129            if self.response_type() == HostResponseType::GenerateRandData {
3130                let u = self.response();
3131                // Safety:
3132                // Created from a valid Table for this object
3133                // Which contains a valid union in this slot
3134                Some(unsafe { GenerateRandData::init_from_table(u) })
3135            } else {
3136                None
3137            }
3138        }
3139
3140        #[inline]
3141        #[allow(non_snake_case)]
3142        pub fn response_as_ok(&self) -> Option<Ok<'a>> {
3143            if self.response_type() == HostResponseType::Ok {
3144                let u = self.response();
3145                // Safety:
3146                // Created from a valid Table for this object
3147                // Which contains a valid union in this slot
3148                Some(unsafe { Ok::init_from_table(u) })
3149            } else {
3150                None
3151            }
3152        }
3153
3154        #[inline]
3155        #[allow(non_snake_case)]
3156        pub fn response_as_error(&self) -> Option<Error<'a>> {
3157            if self.response_type() == HostResponseType::Error {
3158                let u = self.response();
3159                // Safety:
3160                // Created from a valid Table for this object
3161                // Which contains a valid union in this slot
3162                Some(unsafe { Error::init_from_table(u) })
3163            } else {
3164                None
3165            }
3166        }
3167    }
3168
3169    impl flatbuffers::Verifiable for HostResponse<'_> {
3170        #[inline]
3171        fn run_verifier(
3172            v: &mut flatbuffers::Verifier,
3173            pos: usize,
3174        ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
3175            use self::flatbuffers::Verifiable;
3176            v.visit_table(pos)?
3177                .visit_union::<HostResponseType, _>(
3178                    "response_type",
3179                    Self::VT_RESPONSE_TYPE,
3180                    "response",
3181                    Self::VT_RESPONSE,
3182                    true,
3183                    |key, v, pos| match key {
3184                        HostResponseType::ContractResponse => v
3185                            .verify_union_variant::<flatbuffers::ForwardsUOffset<ContractResponse>>(
3186                                "HostResponseType::ContractResponse",
3187                                pos,
3188                            ),
3189                        HostResponseType::DelegateResponse => v
3190                            .verify_union_variant::<flatbuffers::ForwardsUOffset<DelegateResponse>>(
3191                                "HostResponseType::DelegateResponse",
3192                                pos,
3193                            ),
3194                        HostResponseType::GenerateRandData => v
3195                            .verify_union_variant::<flatbuffers::ForwardsUOffset<GenerateRandData>>(
3196                                "HostResponseType::GenerateRandData",
3197                                pos,
3198                            ),
3199                        HostResponseType::Ok => v
3200                            .verify_union_variant::<flatbuffers::ForwardsUOffset<Ok>>(
3201                                "HostResponseType::Ok",
3202                                pos,
3203                            ),
3204                        HostResponseType::Error => v
3205                            .verify_union_variant::<flatbuffers::ForwardsUOffset<Error>>(
3206                                "HostResponseType::Error",
3207                                pos,
3208                            ),
3209                        _ => Ok(()),
3210                    },
3211                )?
3212                .finish();
3213            Ok(())
3214        }
3215    }
3216    pub struct HostResponseArgs {
3217        pub response_type: HostResponseType,
3218        pub response: Option<flatbuffers::WIPOffset<flatbuffers::UnionWIPOffset>>,
3219    }
3220    impl<'a> Default for HostResponseArgs {
3221        #[inline]
3222        fn default() -> Self {
3223            HostResponseArgs {
3224                response_type: HostResponseType::NONE,
3225                response: None, // required field
3226            }
3227        }
3228    }
3229
3230    pub struct HostResponseBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
3231        fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
3232        start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
3233    }
3234    impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> HostResponseBuilder<'a, 'b, A> {
3235        #[inline]
3236        pub fn add_response_type(&mut self, response_type: HostResponseType) {
3237            self.fbb_.push_slot::<HostResponseType>(
3238                HostResponse::VT_RESPONSE_TYPE,
3239                response_type,
3240                HostResponseType::NONE,
3241            );
3242        }
3243        #[inline]
3244        pub fn add_response(
3245            &mut self,
3246            response: flatbuffers::WIPOffset<flatbuffers::UnionWIPOffset>,
3247        ) {
3248            self.fbb_
3249                .push_slot_always::<flatbuffers::WIPOffset<_>>(HostResponse::VT_RESPONSE, response);
3250        }
3251        #[inline]
3252        pub fn new(
3253            _fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
3254        ) -> HostResponseBuilder<'a, 'b, A> {
3255            let start = _fbb.start_table();
3256            HostResponseBuilder {
3257                fbb_: _fbb,
3258                start_: start,
3259            }
3260        }
3261        #[inline]
3262        pub fn finish(self) -> flatbuffers::WIPOffset<HostResponse<'a>> {
3263            let o = self.fbb_.end_table(self.start_);
3264            self.fbb_.required(o, HostResponse::VT_RESPONSE, "response");
3265            flatbuffers::WIPOffset::new(o.value())
3266        }
3267    }
3268
3269    impl core::fmt::Debug for HostResponse<'_> {
3270        fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
3271            let mut ds = f.debug_struct("HostResponse");
3272            ds.field("response_type", &self.response_type());
3273            match self.response_type() {
3274                HostResponseType::ContractResponse => {
3275                    if let Some(x) = self.response_as_contract_response() {
3276                        ds.field("response", &x)
3277                    } else {
3278                        ds.field(
3279                            "response",
3280                            &"InvalidFlatbuffer: Union discriminant does not match value.",
3281                        )
3282                    }
3283                }
3284                HostResponseType::DelegateResponse => {
3285                    if let Some(x) = self.response_as_delegate_response() {
3286                        ds.field("response", &x)
3287                    } else {
3288                        ds.field(
3289                            "response",
3290                            &"InvalidFlatbuffer: Union discriminant does not match value.",
3291                        )
3292                    }
3293                }
3294                HostResponseType::GenerateRandData => {
3295                    if let Some(x) = self.response_as_generate_rand_data() {
3296                        ds.field("response", &x)
3297                    } else {
3298                        ds.field(
3299                            "response",
3300                            &"InvalidFlatbuffer: Union discriminant does not match value.",
3301                        )
3302                    }
3303                }
3304                HostResponseType::Ok => {
3305                    if let Some(x) = self.response_as_ok() {
3306                        ds.field("response", &x)
3307                    } else {
3308                        ds.field(
3309                            "response",
3310                            &"InvalidFlatbuffer: Union discriminant does not match value.",
3311                        )
3312                    }
3313                }
3314                HostResponseType::Error => {
3315                    if let Some(x) = self.response_as_error() {
3316                        ds.field("response", &x)
3317                    } else {
3318                        ds.field(
3319                            "response",
3320                            &"InvalidFlatbuffer: Union discriminant does not match value.",
3321                        )
3322                    }
3323                }
3324                _ => {
3325                    let x: Option<()> = None;
3326                    ds.field("response", &x)
3327                }
3328            };
3329            ds.finish()
3330        }
3331    }
3332    #[inline]
3333    /// Verifies that a buffer of bytes contains a `HostResponse`
3334    /// and returns it.
3335    /// Note that verification is still experimental and may not
3336    /// catch every error, or be maximally performant. For the
3337    /// previous, unchecked, behavior use
3338    /// `root_as_host_response_unchecked`.
3339    pub fn root_as_host_response(
3340        buf: &[u8],
3341    ) -> Result<HostResponse, flatbuffers::InvalidFlatbuffer> {
3342        flatbuffers::root::<HostResponse>(buf)
3343    }
3344    #[inline]
3345    /// Verifies that a buffer of bytes contains a size prefixed
3346    /// `HostResponse` and returns it.
3347    /// Note that verification is still experimental and may not
3348    /// catch every error, or be maximally performant. For the
3349    /// previous, unchecked, behavior use
3350    /// `size_prefixed_root_as_host_response_unchecked`.
3351    pub fn size_prefixed_root_as_host_response(
3352        buf: &[u8],
3353    ) -> Result<HostResponse, flatbuffers::InvalidFlatbuffer> {
3354        flatbuffers::size_prefixed_root::<HostResponse>(buf)
3355    }
3356    #[inline]
3357    /// Verifies, with the given options, that a buffer of bytes
3358    /// contains a `HostResponse` and returns it.
3359    /// Note that verification is still experimental and may not
3360    /// catch every error, or be maximally performant. For the
3361    /// previous, unchecked, behavior use
3362    /// `root_as_host_response_unchecked`.
3363    pub fn root_as_host_response_with_opts<'b, 'o>(
3364        opts: &'o flatbuffers::VerifierOptions,
3365        buf: &'b [u8],
3366    ) -> Result<HostResponse<'b>, flatbuffers::InvalidFlatbuffer> {
3367        flatbuffers::root_with_opts::<HostResponse<'b>>(opts, buf)
3368    }
3369    #[inline]
3370    /// Verifies, with the given verifier options, that a buffer of
3371    /// bytes contains a size prefixed `HostResponse` and returns
3372    /// it. Note that verification is still experimental and may not
3373    /// catch every error, or be maximally performant. For the
3374    /// previous, unchecked, behavior use
3375    /// `root_as_host_response_unchecked`.
3376    pub fn size_prefixed_root_as_host_response_with_opts<'b, 'o>(
3377        opts: &'o flatbuffers::VerifierOptions,
3378        buf: &'b [u8],
3379    ) -> Result<HostResponse<'b>, flatbuffers::InvalidFlatbuffer> {
3380        flatbuffers::size_prefixed_root_with_opts::<HostResponse<'b>>(opts, buf)
3381    }
3382    #[inline]
3383    /// Assumes, without verification, that a buffer of bytes contains a HostResponse and returns it.
3384    /// # Safety
3385    /// Callers must trust the given bytes do indeed contain a valid `HostResponse`.
3386    pub unsafe fn root_as_host_response_unchecked(buf: &[u8]) -> HostResponse {
3387        flatbuffers::root_unchecked::<HostResponse>(buf)
3388    }
3389    #[inline]
3390    /// Assumes, without verification, that a buffer of bytes contains a size prefixed HostResponse and returns it.
3391    /// # Safety
3392    /// Callers must trust the given bytes do indeed contain a valid size prefixed `HostResponse`.
3393    pub unsafe fn size_prefixed_root_as_host_response_unchecked(buf: &[u8]) -> HostResponse {
3394        flatbuffers::size_prefixed_root_unchecked::<HostResponse>(buf)
3395    }
3396    #[inline]
3397    pub fn finish_host_response_buffer<'a, 'b, A: flatbuffers::Allocator + 'a>(
3398        fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
3399        root: flatbuffers::WIPOffset<HostResponse<'a>>,
3400    ) {
3401        fbb.finish(root, None);
3402    }
3403
3404    #[inline]
3405    pub fn finish_size_prefixed_host_response_buffer<'a, 'b, A: flatbuffers::Allocator + 'a>(
3406        fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
3407        root: flatbuffers::WIPOffset<HostResponse<'a>>,
3408    ) {
3409        fbb.finish_size_prefixed(root, None);
3410    }
3411} // pub mod host_response