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