freenet_stdlib/generated/
common_generated.rs

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