1use core::mem;
7use core::cmp::Ordering;
8
9extern crate flatbuffers;
10use self::flatbuffers::{EndianScalar, Follow};
11
12#[allow(unused_imports, dead_code)]
13pub mod protocol {
14
15 use core::mem;
16 use core::cmp::Ordering;
17
18 extern crate flatbuffers;
19 use self::flatbuffers::{EndianScalar, Follow};
20
21#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
22pub const ENUM_MIN_VALUE: u8 = 0;
23#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
24pub const ENUM_MAX_VALUE: u8 = 8;
25#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
26#[allow(non_camel_case_types)]
27pub const ENUM_VALUES_VALUE: [Value; 9] = [
28 Value::NONE,
29 Value::Null,
30 Value::Text,
31 Value::Bool,
32 Value::Integer,
33 Value::Float,
34 Value::List,
35 Value::Document,
36 Value::Time,
37];
38
39#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
40#[repr(transparent)]
41pub struct Value(pub u8);
42#[allow(non_upper_case_globals)]
43impl Value {
44 pub const NONE: Self = Self(0);
45 pub const Null: Self = Self(1);
46 pub const Text: Self = Self(2);
47 pub const Bool: Self = Self(3);
48 pub const Integer: Self = Self(4);
49 pub const Float: Self = Self(5);
50 pub const List: Self = Self(6);
51 pub const Document: Self = Self(7);
52 pub const Time: Self = Self(8);
53
54 pub const ENUM_MIN: u8 = 0;
55 pub const ENUM_MAX: u8 = 8;
56 pub const ENUM_VALUES: &'static [Self] = &[
57 Self::NONE,
58 Self::Null,
59 Self::Text,
60 Self::Bool,
61 Self::Integer,
62 Self::Float,
63 Self::List,
64 Self::Document,
65 Self::Time,
66 ];
67 pub fn variant_name(self) -> Option<&'static str> {
69 match self {
70 Self::NONE => Some("NONE"),
71 Self::Null => Some("Null"),
72 Self::Text => Some("Text"),
73 Self::Bool => Some("Bool"),
74 Self::Integer => Some("Integer"),
75 Self::Float => Some("Float"),
76 Self::List => Some("List"),
77 Self::Document => Some("Document"),
78 Self::Time => Some("Time"),
79 _ => None,
80 }
81 }
82}
83impl core::fmt::Debug for Value {
84 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
85 if let Some(name) = self.variant_name() {
86 f.write_str(name)
87 } else {
88 f.write_fmt(format_args!("<UNKNOWN {:?}>", self.0))
89 }
90 }
91}
92impl<'a> flatbuffers::Follow<'a> for Value {
93 type Inner = Self;
94 #[inline]
95 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
96 let b = flatbuffers::read_scalar_at::<u8>(buf, loc);
97 Self(b)
98 }
99}
100
101impl flatbuffers::Push for Value {
102 type Output = Value;
103 #[inline]
104 unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
105 flatbuffers::emplace_scalar::<u8>(dst, self.0);
106 }
107}
108
109impl flatbuffers::EndianScalar for Value {
110 type Scalar = u8;
111 #[inline]
112 fn to_little_endian(self) -> u8 {
113 self.0.to_le()
114 }
115 #[inline]
116 #[allow(clippy::wrong_self_convention)]
117 fn from_little_endian(v: u8) -> Self {
118 let b = u8::from_le(v);
119 Self(b)
120 }
121}
122
123impl<'a> flatbuffers::Verifiable for Value {
124 #[inline]
125 fn run_verifier(
126 v: &mut flatbuffers::Verifier, pos: usize
127 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
128 use self::flatbuffers::Verifiable;
129 u8::run_verifier(v, pos)
130 }
131}
132
133impl flatbuffers::SimpleToVerifyInSlice for Value {}
134pub struct ValueUnionTableOffset {}
135
136#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
137pub const ENUM_MIN_TRANSFORM_TYPE: u8 = 0;
138#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
139pub const ENUM_MAX_TRANSFORM_TYPE: u8 = 1;
140#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
141#[allow(non_camel_case_types)]
142pub const ENUM_VALUES_TRANSFORM_TYPE: [TransformType; 2] = [
143 TransformType::NONE,
144 TransformType::LanguageTransform,
145];
146
147#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
148#[repr(transparent)]
149pub struct TransformType(pub u8);
150#[allow(non_upper_case_globals)]
151impl TransformType {
152 pub const NONE: Self = Self(0);
153 pub const LanguageTransform: Self = Self(1);
154
155 pub const ENUM_MIN: u8 = 0;
156 pub const ENUM_MAX: u8 = 1;
157 pub const ENUM_VALUES: &'static [Self] = &[
158 Self::NONE,
159 Self::LanguageTransform,
160 ];
161 pub fn variant_name(self) -> Option<&'static str> {
163 match self {
164 Self::NONE => Some("NONE"),
165 Self::LanguageTransform => Some("LanguageTransform"),
166 _ => None,
167 }
168 }
169}
170impl core::fmt::Debug for TransformType {
171 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
172 if let Some(name) = self.variant_name() {
173 f.write_str(name)
174 } else {
175 f.write_fmt(format_args!("<UNKNOWN {:?}>", self.0))
176 }
177 }
178}
179impl<'a> flatbuffers::Follow<'a> for TransformType {
180 type Inner = Self;
181 #[inline]
182 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
183 let b = flatbuffers::read_scalar_at::<u8>(buf, loc);
184 Self(b)
185 }
186}
187
188impl flatbuffers::Push for TransformType {
189 type Output = TransformType;
190 #[inline]
191 unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
192 flatbuffers::emplace_scalar::<u8>(dst, self.0);
193 }
194}
195
196impl flatbuffers::EndianScalar for TransformType {
197 type Scalar = u8;
198 #[inline]
199 fn to_little_endian(self) -> u8 {
200 self.0.to_le()
201 }
202 #[inline]
203 #[allow(clippy::wrong_self_convention)]
204 fn from_little_endian(v: u8) -> Self {
205 let b = u8::from_le(v);
206 Self(b)
207 }
208}
209
210impl<'a> flatbuffers::Verifiable for TransformType {
211 #[inline]
212 fn run_verifier(
213 v: &mut flatbuffers::Verifier, pos: usize
214 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
215 use self::flatbuffers::Verifiable;
216 u8::run_verifier(v, pos)
217 }
218}
219
220impl flatbuffers::SimpleToVerifyInSlice for TransformType {}
221pub struct TransformTypeUnionTableOffset {}
222
223#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
224pub const ENUM_MIN_PLAN_STATUS: i8 = 0;
225#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
226pub const ENUM_MAX_PLAN_STATUS: i8 = 2;
227#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
228#[allow(non_camel_case_types)]
229pub const ENUM_VALUES_PLAN_STATUS: [PlanStatus; 3] = [
230 PlanStatus::Running,
231 PlanStatus::Stopped,
232 PlanStatus::Error,
233];
234
235#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
236#[repr(transparent)]
237pub struct PlanStatus(pub i8);
238#[allow(non_upper_case_globals)]
239impl PlanStatus {
240 pub const Running: Self = Self(0);
241 pub const Stopped: Self = Self(1);
242 pub const Error: Self = Self(2);
243
244 pub const ENUM_MIN: i8 = 0;
245 pub const ENUM_MAX: i8 = 2;
246 pub const ENUM_VALUES: &'static [Self] = &[
247 Self::Running,
248 Self::Stopped,
249 Self::Error,
250 ];
251 pub fn variant_name(self) -> Option<&'static str> {
253 match self {
254 Self::Running => Some("Running"),
255 Self::Stopped => Some("Stopped"),
256 Self::Error => Some("Error"),
257 _ => None,
258 }
259 }
260}
261impl core::fmt::Debug for PlanStatus {
262 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
263 if let Some(name) = self.variant_name() {
264 f.write_str(name)
265 } else {
266 f.write_fmt(format_args!("<UNKNOWN {:?}>", self.0))
267 }
268 }
269}
270impl<'a> flatbuffers::Follow<'a> for PlanStatus {
271 type Inner = Self;
272 #[inline]
273 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
274 let b = flatbuffers::read_scalar_at::<i8>(buf, loc);
275 Self(b)
276 }
277}
278
279impl flatbuffers::Push for PlanStatus {
280 type Output = PlanStatus;
281 #[inline]
282 unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
283 flatbuffers::emplace_scalar::<i8>(dst, self.0);
284 }
285}
286
287impl flatbuffers::EndianScalar for PlanStatus {
288 type Scalar = i8;
289 #[inline]
290 fn to_little_endian(self) -> i8 {
291 self.0.to_le()
292 }
293 #[inline]
294 #[allow(clippy::wrong_self_convention)]
295 fn from_little_endian(v: i8) -> Self {
296 let b = i8::from_le(v);
297 Self(b)
298 }
299}
300
301impl<'a> flatbuffers::Verifiable for PlanStatus {
302 #[inline]
303 fn run_verifier(
304 v: &mut flatbuffers::Verifier, pos: usize
305 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
306 use self::flatbuffers::Verifiable;
307 i8::run_verifier(v, pos)
308 }
309}
310
311impl flatbuffers::SimpleToVerifyInSlice for PlanStatus {}
312#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
313pub const ENUM_MIN_FILTER_TYPE: u8 = 0;
314#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
315pub const ENUM_MAX_FILTER_TYPE: u8 = 1;
316#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
317#[allow(non_camel_case_types)]
318pub const ENUM_VALUES_FILTER_TYPE: [FilterType; 2] = [
319 FilterType::NONE,
320 FilterType::ByName,
321];
322
323#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
324#[repr(transparent)]
325pub struct FilterType(pub u8);
326#[allow(non_upper_case_globals)]
327impl FilterType {
328 pub const NONE: Self = Self(0);
329 pub const ByName: Self = Self(1);
330
331 pub const ENUM_MIN: u8 = 0;
332 pub const ENUM_MAX: u8 = 1;
333 pub const ENUM_VALUES: &'static [Self] = &[
334 Self::NONE,
335 Self::ByName,
336 ];
337 pub fn variant_name(self) -> Option<&'static str> {
339 match self {
340 Self::NONE => Some("NONE"),
341 Self::ByName => Some("ByName"),
342 _ => None,
343 }
344 }
345}
346impl core::fmt::Debug for FilterType {
347 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
348 if let Some(name) = self.variant_name() {
349 f.write_str(name)
350 } else {
351 f.write_fmt(format_args!("<UNKNOWN {:?}>", self.0))
352 }
353 }
354}
355impl<'a> flatbuffers::Follow<'a> for FilterType {
356 type Inner = Self;
357 #[inline]
358 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
359 let b = flatbuffers::read_scalar_at::<u8>(buf, loc);
360 Self(b)
361 }
362}
363
364impl flatbuffers::Push for FilterType {
365 type Output = FilterType;
366 #[inline]
367 unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
368 flatbuffers::emplace_scalar::<u8>(dst, self.0);
369 }
370}
371
372impl flatbuffers::EndianScalar for FilterType {
373 type Scalar = u8;
374 #[inline]
375 fn to_little_endian(self) -> u8 {
376 self.0.to_le()
377 }
378 #[inline]
379 #[allow(clippy::wrong_self_convention)]
380 fn from_little_endian(v: u8) -> Self {
381 let b = u8::from_le(v);
382 Self(b)
383 }
384}
385
386impl<'a> flatbuffers::Verifiable for FilterType {
387 #[inline]
388 fn run_verifier(
389 v: &mut flatbuffers::Verifier, pos: usize
390 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
391 use self::flatbuffers::Verifiable;
392 u8::run_verifier(v, pos)
393 }
394}
395
396impl flatbuffers::SimpleToVerifyInSlice for FilterType {}
397pub struct FilterTypeUnionTableOffset {}
398
399#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
400pub const ENUM_MIN_STATUS: u8 = 0;
401#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
402pub const ENUM_MAX_STATUS: u8 = 2;
403#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
404#[allow(non_camel_case_types)]
405pub const ENUM_VALUES_STATUS: [Status; 3] = [
406 Status::NONE,
407 Status::OkStatus,
408 Status::ErrorStatus,
409];
410
411#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
412#[repr(transparent)]
413pub struct Status(pub u8);
414#[allow(non_upper_case_globals)]
415impl Status {
416 pub const NONE: Self = Self(0);
417 pub const OkStatus: Self = Self(1);
418 pub const ErrorStatus: Self = Self(2);
419
420 pub const ENUM_MIN: u8 = 0;
421 pub const ENUM_MAX: u8 = 2;
422 pub const ENUM_VALUES: &'static [Self] = &[
423 Self::NONE,
424 Self::OkStatus,
425 Self::ErrorStatus,
426 ];
427 pub fn variant_name(self) -> Option<&'static str> {
429 match self {
430 Self::NONE => Some("NONE"),
431 Self::OkStatus => Some("OkStatus"),
432 Self::ErrorStatus => Some("ErrorStatus"),
433 _ => None,
434 }
435 }
436}
437impl core::fmt::Debug for Status {
438 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
439 if let Some(name) = self.variant_name() {
440 f.write_str(name)
441 } else {
442 f.write_fmt(format_args!("<UNKNOWN {:?}>", self.0))
443 }
444 }
445}
446impl<'a> flatbuffers::Follow<'a> for Status {
447 type Inner = Self;
448 #[inline]
449 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
450 let b = flatbuffers::read_scalar_at::<u8>(buf, loc);
451 Self(b)
452 }
453}
454
455impl flatbuffers::Push for Status {
456 type Output = Status;
457 #[inline]
458 unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
459 flatbuffers::emplace_scalar::<u8>(dst, self.0);
460 }
461}
462
463impl flatbuffers::EndianScalar for Status {
464 type Scalar = u8;
465 #[inline]
466 fn to_little_endian(self) -> u8 {
467 self.0.to_le()
468 }
469 #[inline]
470 #[allow(clippy::wrong_self_convention)]
471 fn from_little_endian(v: u8) -> Self {
472 let b = u8::from_le(v);
473 Self(b)
474 }
475}
476
477impl<'a> flatbuffers::Verifiable for Status {
478 #[inline]
479 fn run_verifier(
480 v: &mut flatbuffers::Verifier, pos: usize
481 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
482 use self::flatbuffers::Verifiable;
483 u8::run_verifier(v, pos)
484 }
485}
486
487impl flatbuffers::SimpleToVerifyInSlice for Status {}
488pub struct StatusUnionTableOffset {}
489
490#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
491pub const ENUM_MIN_PAYLOAD: u8 = 0;
492#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
493pub const ENUM_MAX_PAYLOAD: u8 = 13;
494#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
495#[allow(non_camel_case_types)]
496pub const ENUM_VALUES_PAYLOAD: [Payload; 14] = [
497 Payload::NONE,
498 Payload::CreatePlanRequest,
499 Payload::CreatePlanResponse,
500 Payload::GetPlanRequest,
501 Payload::GetPlansRequest,
502 Payload::Train,
503 Payload::Catalog,
504 Payload::RegisterRequest,
505 Payload::RegisterResponse,
506 Payload::BindRequest,
507 Payload::BindResponse,
508 Payload::UnbindRequest,
509 Payload::UnbindResponse,
510 Payload::Disconnect,
511];
512
513#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
514#[repr(transparent)]
515pub struct Payload(pub u8);
516#[allow(non_upper_case_globals)]
517impl Payload {
518 pub const NONE: Self = Self(0);
519 pub const CreatePlanRequest: Self = Self(1);
520 pub const CreatePlanResponse: Self = Self(2);
521 pub const GetPlanRequest: Self = Self(3);
522 pub const GetPlansRequest: Self = Self(4);
523 pub const Train: Self = Self(5);
524 pub const Catalog: Self = Self(6);
525 pub const RegisterRequest: Self = Self(7);
526 pub const RegisterResponse: Self = Self(8);
527 pub const BindRequest: Self = Self(9);
528 pub const BindResponse: Self = Self(10);
529 pub const UnbindRequest: Self = Self(11);
530 pub const UnbindResponse: Self = Self(12);
531 pub const Disconnect: Self = Self(13);
532
533 pub const ENUM_MIN: u8 = 0;
534 pub const ENUM_MAX: u8 = 13;
535 pub const ENUM_VALUES: &'static [Self] = &[
536 Self::NONE,
537 Self::CreatePlanRequest,
538 Self::CreatePlanResponse,
539 Self::GetPlanRequest,
540 Self::GetPlansRequest,
541 Self::Train,
542 Self::Catalog,
543 Self::RegisterRequest,
544 Self::RegisterResponse,
545 Self::BindRequest,
546 Self::BindResponse,
547 Self::UnbindRequest,
548 Self::UnbindResponse,
549 Self::Disconnect,
550 ];
551 pub fn variant_name(self) -> Option<&'static str> {
553 match self {
554 Self::NONE => Some("NONE"),
555 Self::CreatePlanRequest => Some("CreatePlanRequest"),
556 Self::CreatePlanResponse => Some("CreatePlanResponse"),
557 Self::GetPlanRequest => Some("GetPlanRequest"),
558 Self::GetPlansRequest => Some("GetPlansRequest"),
559 Self::Train => Some("Train"),
560 Self::Catalog => Some("Catalog"),
561 Self::RegisterRequest => Some("RegisterRequest"),
562 Self::RegisterResponse => Some("RegisterResponse"),
563 Self::BindRequest => Some("BindRequest"),
564 Self::BindResponse => Some("BindResponse"),
565 Self::UnbindRequest => Some("UnbindRequest"),
566 Self::UnbindResponse => Some("UnbindResponse"),
567 Self::Disconnect => Some("Disconnect"),
568 _ => None,
569 }
570 }
571}
572impl core::fmt::Debug for Payload {
573 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
574 if let Some(name) = self.variant_name() {
575 f.write_str(name)
576 } else {
577 f.write_fmt(format_args!("<UNKNOWN {:?}>", self.0))
578 }
579 }
580}
581impl<'a> flatbuffers::Follow<'a> for Payload {
582 type Inner = Self;
583 #[inline]
584 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
585 let b = flatbuffers::read_scalar_at::<u8>(buf, loc);
586 Self(b)
587 }
588}
589
590impl flatbuffers::Push for Payload {
591 type Output = Payload;
592 #[inline]
593 unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
594 flatbuffers::emplace_scalar::<u8>(dst, self.0);
595 }
596}
597
598impl flatbuffers::EndianScalar for Payload {
599 type Scalar = u8;
600 #[inline]
601 fn to_little_endian(self) -> u8 {
602 self.0.to_le()
603 }
604 #[inline]
605 #[allow(clippy::wrong_self_convention)]
606 fn from_little_endian(v: u8) -> Self {
607 let b = u8::from_le(v);
608 Self(b)
609 }
610}
611
612impl<'a> flatbuffers::Verifiable for Payload {
613 #[inline]
614 fn run_verifier(
615 v: &mut flatbuffers::Verifier, pos: usize
616 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
617 use self::flatbuffers::Verifiable;
618 u8::run_verifier(v, pos)
619 }
620}
621
622impl flatbuffers::SimpleToVerifyInSlice for Payload {}
623pub struct PayloadUnionTableOffset {}
624
625pub enum NullOffset {}
626#[derive(Copy, Clone, PartialEq)]
627
628pub struct Null<'a> {
629 pub _tab: flatbuffers::Table<'a>,
630}
631
632impl<'a> flatbuffers::Follow<'a> for Null<'a> {
633 type Inner = Null<'a>;
634 #[inline]
635 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
636 Self { _tab: flatbuffers::Table::new(buf, loc) }
637 }
638}
639
640impl<'a> Null<'a> {
641
642 #[inline]
643 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
644 Null { _tab: table }
645 }
646 #[allow(unused_mut)]
647 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
648 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
649 _args: &'args NullArgs
650 ) -> flatbuffers::WIPOffset<Null<'bldr>> {
651 let mut builder = NullBuilder::new(_fbb);
652 builder.finish()
653 }
654
655}
656
657impl flatbuffers::Verifiable for Null<'_> {
658 #[inline]
659 fn run_verifier(
660 v: &mut flatbuffers::Verifier, pos: usize
661 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
662 use self::flatbuffers::Verifiable;
663 v.visit_table(pos)?
664 .finish();
665 Ok(())
666 }
667}
668pub struct NullArgs {
669}
670impl<'a> Default for NullArgs {
671 #[inline]
672 fn default() -> Self {
673 NullArgs {
674 }
675 }
676}
677
678pub struct NullBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
679 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
680 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
681}
682impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> NullBuilder<'a, 'b, A> {
683 #[inline]
684 pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> NullBuilder<'a, 'b, A> {
685 let start = _fbb.start_table();
686 NullBuilder {
687 fbb_: _fbb,
688 start_: start,
689 }
690 }
691 #[inline]
692 pub fn finish(self) -> flatbuffers::WIPOffset<Null<'a>> {
693 let o = self.fbb_.end_table(self.start_);
694 flatbuffers::WIPOffset::new(o.value())
695 }
696}
697
698impl core::fmt::Debug for Null<'_> {
699 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
700 let mut ds = f.debug_struct("Null");
701 ds.finish()
702 }
703}
704pub enum TimeOffset {}
705#[derive(Copy, Clone, PartialEq)]
706
707pub struct Time<'a> {
708 pub _tab: flatbuffers::Table<'a>,
709}
710
711impl<'a> flatbuffers::Follow<'a> for Time<'a> {
712 type Inner = Time<'a>;
713 #[inline]
714 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
715 Self { _tab: flatbuffers::Table::new(buf, loc) }
716 }
717}
718
719impl<'a> Time<'a> {
720 pub const VT_DATA: flatbuffers::VOffsetT = 4;
721
722 #[inline]
723 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
724 Time { _tab: table }
725 }
726 #[allow(unused_mut)]
727 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
728 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
729 args: &'args TimeArgs
730 ) -> flatbuffers::WIPOffset<Time<'bldr>> {
731 let mut builder = TimeBuilder::new(_fbb);
732 builder.add_data(args.data);
733 builder.finish()
734 }
735
736
737 #[inline]
738 pub fn data(&self) -> i64 {
739 unsafe { self._tab.get::<i64>(Time::VT_DATA, Some(0)).unwrap()}
743 }
744}
745
746impl flatbuffers::Verifiable for Time<'_> {
747 #[inline]
748 fn run_verifier(
749 v: &mut flatbuffers::Verifier, pos: usize
750 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
751 use self::flatbuffers::Verifiable;
752 v.visit_table(pos)?
753 .visit_field::<i64>("data", Self::VT_DATA, false)?
754 .finish();
755 Ok(())
756 }
757}
758pub struct TimeArgs {
759 pub data: i64,
760}
761impl<'a> Default for TimeArgs {
762 #[inline]
763 fn default() -> Self {
764 TimeArgs {
765 data: 0,
766 }
767 }
768}
769
770pub struct TimeBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
771 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
772 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
773}
774impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> TimeBuilder<'a, 'b, A> {
775 #[inline]
776 pub fn add_data(&mut self, data: i64) {
777 self.fbb_.push_slot::<i64>(Time::VT_DATA, data, 0);
778 }
779 #[inline]
780 pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> TimeBuilder<'a, 'b, A> {
781 let start = _fbb.start_table();
782 TimeBuilder {
783 fbb_: _fbb,
784 start_: start,
785 }
786 }
787 #[inline]
788 pub fn finish(self) -> flatbuffers::WIPOffset<Time<'a>> {
789 let o = self.fbb_.end_table(self.start_);
790 flatbuffers::WIPOffset::new(o.value())
791 }
792}
793
794impl core::fmt::Debug for Time<'_> {
795 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
796 let mut ds = f.debug_struct("Time");
797 ds.field("data", &self.data());
798 ds.finish()
799 }
800}
801pub enum BoolOffset {}
802#[derive(Copy, Clone, PartialEq)]
803
804pub struct Bool<'a> {
805 pub _tab: flatbuffers::Table<'a>,
806}
807
808impl<'a> flatbuffers::Follow<'a> for Bool<'a> {
809 type Inner = Bool<'a>;
810 #[inline]
811 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
812 Self { _tab: flatbuffers::Table::new(buf, loc) }
813 }
814}
815
816impl<'a> Bool<'a> {
817 pub const VT_DATA: flatbuffers::VOffsetT = 4;
818
819 #[inline]
820 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
821 Bool { _tab: table }
822 }
823 #[allow(unused_mut)]
824 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
825 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
826 args: &'args BoolArgs
827 ) -> flatbuffers::WIPOffset<Bool<'bldr>> {
828 let mut builder = BoolBuilder::new(_fbb);
829 builder.add_data(args.data);
830 builder.finish()
831 }
832
833
834 #[inline]
835 pub fn data(&self) -> bool {
836 unsafe { self._tab.get::<bool>(Bool::VT_DATA, Some(false)).unwrap()}
840 }
841}
842
843impl flatbuffers::Verifiable for Bool<'_> {
844 #[inline]
845 fn run_verifier(
846 v: &mut flatbuffers::Verifier, pos: usize
847 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
848 use self::flatbuffers::Verifiable;
849 v.visit_table(pos)?
850 .visit_field::<bool>("data", Self::VT_DATA, false)?
851 .finish();
852 Ok(())
853 }
854}
855pub struct BoolArgs {
856 pub data: bool,
857}
858impl<'a> Default for BoolArgs {
859 #[inline]
860 fn default() -> Self {
861 BoolArgs {
862 data: false,
863 }
864 }
865}
866
867pub struct BoolBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
868 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
869 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
870}
871impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> BoolBuilder<'a, 'b, A> {
872 #[inline]
873 pub fn add_data(&mut self, data: bool) {
874 self.fbb_.push_slot::<bool>(Bool::VT_DATA, data, false);
875 }
876 #[inline]
877 pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> BoolBuilder<'a, 'b, A> {
878 let start = _fbb.start_table();
879 BoolBuilder {
880 fbb_: _fbb,
881 start_: start,
882 }
883 }
884 #[inline]
885 pub fn finish(self) -> flatbuffers::WIPOffset<Bool<'a>> {
886 let o = self.fbb_.end_table(self.start_);
887 flatbuffers::WIPOffset::new(o.value())
888 }
889}
890
891impl core::fmt::Debug for Bool<'_> {
892 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
893 let mut ds = f.debug_struct("Bool");
894 ds.field("data", &self.data());
895 ds.finish()
896 }
897}
898pub enum TextOffset {}
899#[derive(Copy, Clone, PartialEq)]
900
901pub struct Text<'a> {
902 pub _tab: flatbuffers::Table<'a>,
903}
904
905impl<'a> flatbuffers::Follow<'a> for Text<'a> {
906 type Inner = Text<'a>;
907 #[inline]
908 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
909 Self { _tab: flatbuffers::Table::new(buf, loc) }
910 }
911}
912
913impl<'a> Text<'a> {
914 pub const VT_DATA: flatbuffers::VOffsetT = 4;
915
916 #[inline]
917 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
918 Text { _tab: table }
919 }
920 #[allow(unused_mut)]
921 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
922 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
923 args: &'args TextArgs<'args>
924 ) -> flatbuffers::WIPOffset<Text<'bldr>> {
925 let mut builder = TextBuilder::new(_fbb);
926 if let Some(x) = args.data { builder.add_data(x); }
927 builder.finish()
928 }
929
930
931 #[inline]
932 pub fn data(&self) -> &'a str {
933 unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<&str>>(Text::VT_DATA, None).unwrap()}
937 }
938}
939
940impl flatbuffers::Verifiable for Text<'_> {
941 #[inline]
942 fn run_verifier(
943 v: &mut flatbuffers::Verifier, pos: usize
944 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
945 use self::flatbuffers::Verifiable;
946 v.visit_table(pos)?
947 .visit_field::<flatbuffers::ForwardsUOffset<&str>>("data", Self::VT_DATA, true)?
948 .finish();
949 Ok(())
950 }
951}
952pub struct TextArgs<'a> {
953 pub data: Option<flatbuffers::WIPOffset<&'a str>>,
954}
955impl<'a> Default for TextArgs<'a> {
956 #[inline]
957 fn default() -> Self {
958 TextArgs {
959 data: None, }
961 }
962}
963
964pub struct TextBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
965 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
966 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
967}
968impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> TextBuilder<'a, 'b, A> {
969 #[inline]
970 pub fn add_data(&mut self, data: flatbuffers::WIPOffset<&'b str>) {
971 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Text::VT_DATA, data);
972 }
973 #[inline]
974 pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> TextBuilder<'a, 'b, A> {
975 let start = _fbb.start_table();
976 TextBuilder {
977 fbb_: _fbb,
978 start_: start,
979 }
980 }
981 #[inline]
982 pub fn finish(self) -> flatbuffers::WIPOffset<Text<'a>> {
983 let o = self.fbb_.end_table(self.start_);
984 self.fbb_.required(o, Text::VT_DATA,"data");
985 flatbuffers::WIPOffset::new(o.value())
986 }
987}
988
989impl core::fmt::Debug for Text<'_> {
990 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
991 let mut ds = f.debug_struct("Text");
992 ds.field("data", &self.data());
993 ds.finish()
994 }
995}
996pub enum IntegerOffset {}
997#[derive(Copy, Clone, PartialEq)]
998
999pub struct Integer<'a> {
1000 pub _tab: flatbuffers::Table<'a>,
1001}
1002
1003impl<'a> flatbuffers::Follow<'a> for Integer<'a> {
1004 type Inner = Integer<'a>;
1005 #[inline]
1006 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
1007 Self { _tab: flatbuffers::Table::new(buf, loc) }
1008 }
1009}
1010
1011impl<'a> Integer<'a> {
1012 pub const VT_DATA: flatbuffers::VOffsetT = 4;
1013
1014 #[inline]
1015 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
1016 Integer { _tab: table }
1017 }
1018 #[allow(unused_mut)]
1019 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
1020 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
1021 args: &'args IntegerArgs
1022 ) -> flatbuffers::WIPOffset<Integer<'bldr>> {
1023 let mut builder = IntegerBuilder::new(_fbb);
1024 builder.add_data(args.data);
1025 builder.finish()
1026 }
1027
1028
1029 #[inline]
1030 pub fn data(&self) -> i64 {
1031 unsafe { self._tab.get::<i64>(Integer::VT_DATA, Some(0)).unwrap()}
1035 }
1036}
1037
1038impl flatbuffers::Verifiable for Integer<'_> {
1039 #[inline]
1040 fn run_verifier(
1041 v: &mut flatbuffers::Verifier, pos: usize
1042 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
1043 use self::flatbuffers::Verifiable;
1044 v.visit_table(pos)?
1045 .visit_field::<i64>("data", Self::VT_DATA, false)?
1046 .finish();
1047 Ok(())
1048 }
1049}
1050pub struct IntegerArgs {
1051 pub data: i64,
1052}
1053impl<'a> Default for IntegerArgs {
1054 #[inline]
1055 fn default() -> Self {
1056 IntegerArgs {
1057 data: 0,
1058 }
1059 }
1060}
1061
1062pub struct IntegerBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
1063 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
1064 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
1065}
1066impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> IntegerBuilder<'a, 'b, A> {
1067 #[inline]
1068 pub fn add_data(&mut self, data: i64) {
1069 self.fbb_.push_slot::<i64>(Integer::VT_DATA, data, 0);
1070 }
1071 #[inline]
1072 pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> IntegerBuilder<'a, 'b, A> {
1073 let start = _fbb.start_table();
1074 IntegerBuilder {
1075 fbb_: _fbb,
1076 start_: start,
1077 }
1078 }
1079 #[inline]
1080 pub fn finish(self) -> flatbuffers::WIPOffset<Integer<'a>> {
1081 let o = self.fbb_.end_table(self.start_);
1082 flatbuffers::WIPOffset::new(o.value())
1083 }
1084}
1085
1086impl core::fmt::Debug for Integer<'_> {
1087 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
1088 let mut ds = f.debug_struct("Integer");
1089 ds.field("data", &self.data());
1090 ds.finish()
1091 }
1092}
1093pub enum FloatOffset {}
1094#[derive(Copy, Clone, PartialEq)]
1095
1096pub struct Float<'a> {
1097 pub _tab: flatbuffers::Table<'a>,
1098}
1099
1100impl<'a> flatbuffers::Follow<'a> for Float<'a> {
1101 type Inner = Float<'a>;
1102 #[inline]
1103 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
1104 Self { _tab: flatbuffers::Table::new(buf, loc) }
1105 }
1106}
1107
1108impl<'a> Float<'a> {
1109 pub const VT_DATA: flatbuffers::VOffsetT = 4;
1110
1111 #[inline]
1112 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
1113 Float { _tab: table }
1114 }
1115 #[allow(unused_mut)]
1116 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
1117 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
1118 args: &'args FloatArgs
1119 ) -> flatbuffers::WIPOffset<Float<'bldr>> {
1120 let mut builder = FloatBuilder::new(_fbb);
1121 builder.add_data(args.data);
1122 builder.finish()
1123 }
1124
1125
1126 #[inline]
1127 pub fn data(&self) -> f32 {
1128 unsafe { self._tab.get::<f32>(Float::VT_DATA, Some(0.0)).unwrap()}
1132 }
1133}
1134
1135impl flatbuffers::Verifiable for Float<'_> {
1136 #[inline]
1137 fn run_verifier(
1138 v: &mut flatbuffers::Verifier, pos: usize
1139 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
1140 use self::flatbuffers::Verifiable;
1141 v.visit_table(pos)?
1142 .visit_field::<f32>("data", Self::VT_DATA, false)?
1143 .finish();
1144 Ok(())
1145 }
1146}
1147pub struct FloatArgs {
1148 pub data: f32,
1149}
1150impl<'a> Default for FloatArgs {
1151 #[inline]
1152 fn default() -> Self {
1153 FloatArgs {
1154 data: 0.0,
1155 }
1156 }
1157}
1158
1159pub struct FloatBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
1160 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
1161 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
1162}
1163impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> FloatBuilder<'a, 'b, A> {
1164 #[inline]
1165 pub fn add_data(&mut self, data: f32) {
1166 self.fbb_.push_slot::<f32>(Float::VT_DATA, data, 0.0);
1167 }
1168 #[inline]
1169 pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> FloatBuilder<'a, 'b, A> {
1170 let start = _fbb.start_table();
1171 FloatBuilder {
1172 fbb_: _fbb,
1173 start_: start,
1174 }
1175 }
1176 #[inline]
1177 pub fn finish(self) -> flatbuffers::WIPOffset<Float<'a>> {
1178 let o = self.fbb_.end_table(self.start_);
1179 flatbuffers::WIPOffset::new(o.value())
1180 }
1181}
1182
1183impl core::fmt::Debug for Float<'_> {
1184 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
1185 let mut ds = f.debug_struct("Float");
1186 ds.field("data", &self.data());
1187 ds.finish()
1188 }
1189}
1190pub enum ValueWrapperOffset {}
1191#[derive(Copy, Clone, PartialEq)]
1192
1193pub struct ValueWrapper<'a> {
1194 pub _tab: flatbuffers::Table<'a>,
1195}
1196
1197impl<'a> flatbuffers::Follow<'a> for ValueWrapper<'a> {
1198 type Inner = ValueWrapper<'a>;
1199 #[inline]
1200 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
1201 Self { _tab: flatbuffers::Table::new(buf, loc) }
1202 }
1203}
1204
1205impl<'a> ValueWrapper<'a> {
1206 pub const VT_DATA_TYPE: flatbuffers::VOffsetT = 4;
1207 pub const VT_DATA: flatbuffers::VOffsetT = 6;
1208
1209 #[inline]
1210 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
1211 ValueWrapper { _tab: table }
1212 }
1213 #[allow(unused_mut)]
1214 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
1215 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
1216 args: &'args ValueWrapperArgs
1217 ) -> flatbuffers::WIPOffset<ValueWrapper<'bldr>> {
1218 let mut builder = ValueWrapperBuilder::new(_fbb);
1219 if let Some(x) = args.data { builder.add_data(x); }
1220 builder.add_data_type(args.data_type);
1221 builder.finish()
1222 }
1223
1224
1225 #[inline]
1226 pub fn data_type(&self) -> Value {
1227 unsafe { self._tab.get::<Value>(ValueWrapper::VT_DATA_TYPE, Some(Value::NONE)).unwrap()}
1231 }
1232 #[inline]
1233 pub fn data(&self) -> flatbuffers::Table<'a> {
1234 unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Table<'a>>>(ValueWrapper::VT_DATA, None).unwrap()}
1238 }
1239 #[inline]
1240 #[allow(non_snake_case)]
1241 pub fn data_as_null(&self) -> Option<Null<'a>> {
1242 if self.data_type() == Value::Null {
1243 let u = self.data();
1244 Some(unsafe { Null::init_from_table(u) })
1248 } else {
1249 None
1250 }
1251 }
1252
1253 #[inline]
1254 #[allow(non_snake_case)]
1255 pub fn data_as_text(&self) -> Option<Text<'a>> {
1256 if self.data_type() == Value::Text {
1257 let u = self.data();
1258 Some(unsafe { Text::init_from_table(u) })
1262 } else {
1263 None
1264 }
1265 }
1266
1267 #[inline]
1268 #[allow(non_snake_case)]
1269 pub fn data_as_bool(&self) -> Option<Bool<'a>> {
1270 if self.data_type() == Value::Bool {
1271 let u = self.data();
1272 Some(unsafe { Bool::init_from_table(u) })
1276 } else {
1277 None
1278 }
1279 }
1280
1281 #[inline]
1282 #[allow(non_snake_case)]
1283 pub fn data_as_integer(&self) -> Option<Integer<'a>> {
1284 if self.data_type() == Value::Integer {
1285 let u = self.data();
1286 Some(unsafe { Integer::init_from_table(u) })
1290 } else {
1291 None
1292 }
1293 }
1294
1295 #[inline]
1296 #[allow(non_snake_case)]
1297 pub fn data_as_float(&self) -> Option<Float<'a>> {
1298 if self.data_type() == Value::Float {
1299 let u = self.data();
1300 Some(unsafe { Float::init_from_table(u) })
1304 } else {
1305 None
1306 }
1307 }
1308
1309 #[inline]
1310 #[allow(non_snake_case)]
1311 pub fn data_as_list(&self) -> Option<List<'a>> {
1312 if self.data_type() == Value::List {
1313 let u = self.data();
1314 Some(unsafe { List::init_from_table(u) })
1318 } else {
1319 None
1320 }
1321 }
1322
1323 #[inline]
1324 #[allow(non_snake_case)]
1325 pub fn data_as_document(&self) -> Option<Document<'a>> {
1326 if self.data_type() == Value::Document {
1327 let u = self.data();
1328 Some(unsafe { Document::init_from_table(u) })
1332 } else {
1333 None
1334 }
1335 }
1336
1337 #[inline]
1338 #[allow(non_snake_case)]
1339 pub fn data_as_time(&self) -> Option<Time<'a>> {
1340 if self.data_type() == Value::Time {
1341 let u = self.data();
1342 Some(unsafe { Time::init_from_table(u) })
1346 } else {
1347 None
1348 }
1349 }
1350
1351}
1352
1353impl flatbuffers::Verifiable for ValueWrapper<'_> {
1354 #[inline]
1355 fn run_verifier(
1356 v: &mut flatbuffers::Verifier, pos: usize
1357 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
1358 use self::flatbuffers::Verifiable;
1359 v.visit_table(pos)?
1360 .visit_union::<Value, _>("data_type", Self::VT_DATA_TYPE, "data", Self::VT_DATA, true, |key, v, pos| {
1361 match key {
1362 Value::Null => v.verify_union_variant::<flatbuffers::ForwardsUOffset<Null>>("Value::Null", pos),
1363 Value::Text => v.verify_union_variant::<flatbuffers::ForwardsUOffset<Text>>("Value::Text", pos),
1364 Value::Bool => v.verify_union_variant::<flatbuffers::ForwardsUOffset<Bool>>("Value::Bool", pos),
1365 Value::Integer => v.verify_union_variant::<flatbuffers::ForwardsUOffset<Integer>>("Value::Integer", pos),
1366 Value::Float => v.verify_union_variant::<flatbuffers::ForwardsUOffset<Float>>("Value::Float", pos),
1367 Value::List => v.verify_union_variant::<flatbuffers::ForwardsUOffset<List>>("Value::List", pos),
1368 Value::Document => v.verify_union_variant::<flatbuffers::ForwardsUOffset<Document>>("Value::Document", pos),
1369 Value::Time => v.verify_union_variant::<flatbuffers::ForwardsUOffset<Time>>("Value::Time", pos),
1370 _ => Ok(()),
1371 }
1372 })?
1373 .finish();
1374 Ok(())
1375 }
1376}
1377pub struct ValueWrapperArgs {
1378 pub data_type: Value,
1379 pub data: Option<flatbuffers::WIPOffset<flatbuffers::UnionWIPOffset>>,
1380}
1381impl<'a> Default for ValueWrapperArgs {
1382 #[inline]
1383 fn default() -> Self {
1384 ValueWrapperArgs {
1385 data_type: Value::NONE,
1386 data: None, }
1388 }
1389}
1390
1391pub struct ValueWrapperBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
1392 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
1393 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
1394}
1395impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> ValueWrapperBuilder<'a, 'b, A> {
1396 #[inline]
1397 pub fn add_data_type(&mut self, data_type: Value) {
1398 self.fbb_.push_slot::<Value>(ValueWrapper::VT_DATA_TYPE, data_type, Value::NONE);
1399 }
1400 #[inline]
1401 pub fn add_data(&mut self, data: flatbuffers::WIPOffset<flatbuffers::UnionWIPOffset>) {
1402 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(ValueWrapper::VT_DATA, data);
1403 }
1404 #[inline]
1405 pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> ValueWrapperBuilder<'a, 'b, A> {
1406 let start = _fbb.start_table();
1407 ValueWrapperBuilder {
1408 fbb_: _fbb,
1409 start_: start,
1410 }
1411 }
1412 #[inline]
1413 pub fn finish(self) -> flatbuffers::WIPOffset<ValueWrapper<'a>> {
1414 let o = self.fbb_.end_table(self.start_);
1415 self.fbb_.required(o, ValueWrapper::VT_DATA,"data");
1416 flatbuffers::WIPOffset::new(o.value())
1417 }
1418}
1419
1420impl core::fmt::Debug for ValueWrapper<'_> {
1421 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
1422 let mut ds = f.debug_struct("ValueWrapper");
1423 ds.field("data_type", &self.data_type());
1424 match self.data_type() {
1425 Value::Null => {
1426 if let Some(x) = self.data_as_null() {
1427 ds.field("data", &x)
1428 } else {
1429 ds.field("data", &"InvalidFlatbuffer: Union discriminant does not match value.")
1430 }
1431 },
1432 Value::Text => {
1433 if let Some(x) = self.data_as_text() {
1434 ds.field("data", &x)
1435 } else {
1436 ds.field("data", &"InvalidFlatbuffer: Union discriminant does not match value.")
1437 }
1438 },
1439 Value::Bool => {
1440 if let Some(x) = self.data_as_bool() {
1441 ds.field("data", &x)
1442 } else {
1443 ds.field("data", &"InvalidFlatbuffer: Union discriminant does not match value.")
1444 }
1445 },
1446 Value::Integer => {
1447 if let Some(x) = self.data_as_integer() {
1448 ds.field("data", &x)
1449 } else {
1450 ds.field("data", &"InvalidFlatbuffer: Union discriminant does not match value.")
1451 }
1452 },
1453 Value::Float => {
1454 if let Some(x) = self.data_as_float() {
1455 ds.field("data", &x)
1456 } else {
1457 ds.field("data", &"InvalidFlatbuffer: Union discriminant does not match value.")
1458 }
1459 },
1460 Value::List => {
1461 if let Some(x) = self.data_as_list() {
1462 ds.field("data", &x)
1463 } else {
1464 ds.field("data", &"InvalidFlatbuffer: Union discriminant does not match value.")
1465 }
1466 },
1467 Value::Document => {
1468 if let Some(x) = self.data_as_document() {
1469 ds.field("data", &x)
1470 } else {
1471 ds.field("data", &"InvalidFlatbuffer: Union discriminant does not match value.")
1472 }
1473 },
1474 Value::Time => {
1475 if let Some(x) = self.data_as_time() {
1476 ds.field("data", &x)
1477 } else {
1478 ds.field("data", &"InvalidFlatbuffer: Union discriminant does not match value.")
1479 }
1480 },
1481 _ => {
1482 let x: Option<()> = None;
1483 ds.field("data", &x)
1484 },
1485 };
1486 ds.finish()
1487 }
1488}
1489pub enum ListOffset {}
1490#[derive(Copy, Clone, PartialEq)]
1491
1492pub struct List<'a> {
1493 pub _tab: flatbuffers::Table<'a>,
1494}
1495
1496impl<'a> flatbuffers::Follow<'a> for List<'a> {
1497 type Inner = List<'a>;
1498 #[inline]
1499 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
1500 Self { _tab: flatbuffers::Table::new(buf, loc) }
1501 }
1502}
1503
1504impl<'a> List<'a> {
1505 pub const VT_DATA: flatbuffers::VOffsetT = 4;
1506
1507 #[inline]
1508 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
1509 List { _tab: table }
1510 }
1511 #[allow(unused_mut)]
1512 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
1513 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
1514 args: &'args ListArgs<'args>
1515 ) -> flatbuffers::WIPOffset<List<'bldr>> {
1516 let mut builder = ListBuilder::new(_fbb);
1517 if let Some(x) = args.data { builder.add_data(x); }
1518 builder.finish()
1519 }
1520
1521
1522 #[inline]
1523 pub fn data(&self) -> flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<ValueWrapper<'a>>> {
1524 unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<ValueWrapper>>>>(List::VT_DATA, None).unwrap()}
1528 }
1529}
1530
1531impl flatbuffers::Verifiable for List<'_> {
1532 #[inline]
1533 fn run_verifier(
1534 v: &mut flatbuffers::Verifier, pos: usize
1535 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
1536 use self::flatbuffers::Verifiable;
1537 v.visit_table(pos)?
1538 .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, flatbuffers::ForwardsUOffset<ValueWrapper>>>>("data", Self::VT_DATA, true)?
1539 .finish();
1540 Ok(())
1541 }
1542}
1543pub struct ListArgs<'a> {
1544 pub data: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<ValueWrapper<'a>>>>>,
1545}
1546impl<'a> Default for ListArgs<'a> {
1547 #[inline]
1548 fn default() -> Self {
1549 ListArgs {
1550 data: None, }
1552 }
1553}
1554
1555pub struct ListBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
1556 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
1557 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
1558}
1559impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> ListBuilder<'a, 'b, A> {
1560 #[inline]
1561 pub fn add_data(&mut self, data: flatbuffers::WIPOffset<flatbuffers::Vector<'b , flatbuffers::ForwardsUOffset<ValueWrapper<'b >>>>) {
1562 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(List::VT_DATA, data);
1563 }
1564 #[inline]
1565 pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> ListBuilder<'a, 'b, A> {
1566 let start = _fbb.start_table();
1567 ListBuilder {
1568 fbb_: _fbb,
1569 start_: start,
1570 }
1571 }
1572 #[inline]
1573 pub fn finish(self) -> flatbuffers::WIPOffset<List<'a>> {
1574 let o = self.fbb_.end_table(self.start_);
1575 self.fbb_.required(o, List::VT_DATA,"data");
1576 flatbuffers::WIPOffset::new(o.value())
1577 }
1578}
1579
1580impl core::fmt::Debug for List<'_> {
1581 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
1582 let mut ds = f.debug_struct("List");
1583 ds.field("data", &self.data());
1584 ds.finish()
1585 }
1586}
1587pub enum KeyValueOffset {}
1588#[derive(Copy, Clone, PartialEq)]
1589
1590pub struct KeyValue<'a> {
1591 pub _tab: flatbuffers::Table<'a>,
1592}
1593
1594impl<'a> flatbuffers::Follow<'a> for KeyValue<'a> {
1595 type Inner = KeyValue<'a>;
1596 #[inline]
1597 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
1598 Self { _tab: flatbuffers::Table::new(buf, loc) }
1599 }
1600}
1601
1602impl<'a> KeyValue<'a> {
1603 pub const VT_KEY_TYPE: flatbuffers::VOffsetT = 4;
1604 pub const VT_KEY: flatbuffers::VOffsetT = 6;
1605 pub const VT_VALUES_TYPE: flatbuffers::VOffsetT = 8;
1606 pub const VT_VALUES: flatbuffers::VOffsetT = 10;
1607
1608 #[inline]
1609 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
1610 KeyValue { _tab: table }
1611 }
1612 #[allow(unused_mut)]
1613 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
1614 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
1615 args: &'args KeyValueArgs
1616 ) -> flatbuffers::WIPOffset<KeyValue<'bldr>> {
1617 let mut builder = KeyValueBuilder::new(_fbb);
1618 if let Some(x) = args.values { builder.add_values(x); }
1619 if let Some(x) = args.key { builder.add_key(x); }
1620 builder.add_values_type(args.values_type);
1621 builder.add_key_type(args.key_type);
1622 builder.finish()
1623 }
1624
1625
1626 #[inline]
1627 pub fn key_type(&self) -> Value {
1628 unsafe { self._tab.get::<Value>(KeyValue::VT_KEY_TYPE, Some(Value::NONE)).unwrap()}
1632 }
1633 #[inline]
1634 pub fn key(&self) -> flatbuffers::Table<'a> {
1635 unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Table<'a>>>(KeyValue::VT_KEY, None).unwrap()}
1639 }
1640 #[inline]
1641 pub fn values_type(&self) -> Value {
1642 unsafe { self._tab.get::<Value>(KeyValue::VT_VALUES_TYPE, Some(Value::NONE)).unwrap()}
1646 }
1647 #[inline]
1648 pub fn values(&self) -> flatbuffers::Table<'a> {
1649 unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Table<'a>>>(KeyValue::VT_VALUES, None).unwrap()}
1653 }
1654 #[inline]
1655 #[allow(non_snake_case)]
1656 pub fn key_as_null(&self) -> Option<Null<'a>> {
1657 if self.key_type() == Value::Null {
1658 let u = self.key();
1659 Some(unsafe { Null::init_from_table(u) })
1663 } else {
1664 None
1665 }
1666 }
1667
1668 #[inline]
1669 #[allow(non_snake_case)]
1670 pub fn key_as_text(&self) -> Option<Text<'a>> {
1671 if self.key_type() == Value::Text {
1672 let u = self.key();
1673 Some(unsafe { Text::init_from_table(u) })
1677 } else {
1678 None
1679 }
1680 }
1681
1682 #[inline]
1683 #[allow(non_snake_case)]
1684 pub fn key_as_bool(&self) -> Option<Bool<'a>> {
1685 if self.key_type() == Value::Bool {
1686 let u = self.key();
1687 Some(unsafe { Bool::init_from_table(u) })
1691 } else {
1692 None
1693 }
1694 }
1695
1696 #[inline]
1697 #[allow(non_snake_case)]
1698 pub fn key_as_integer(&self) -> Option<Integer<'a>> {
1699 if self.key_type() == Value::Integer {
1700 let u = self.key();
1701 Some(unsafe { Integer::init_from_table(u) })
1705 } else {
1706 None
1707 }
1708 }
1709
1710 #[inline]
1711 #[allow(non_snake_case)]
1712 pub fn key_as_float(&self) -> Option<Float<'a>> {
1713 if self.key_type() == Value::Float {
1714 let u = self.key();
1715 Some(unsafe { Float::init_from_table(u) })
1719 } else {
1720 None
1721 }
1722 }
1723
1724 #[inline]
1725 #[allow(non_snake_case)]
1726 pub fn key_as_list(&self) -> Option<List<'a>> {
1727 if self.key_type() == Value::List {
1728 let u = self.key();
1729 Some(unsafe { List::init_from_table(u) })
1733 } else {
1734 None
1735 }
1736 }
1737
1738 #[inline]
1739 #[allow(non_snake_case)]
1740 pub fn key_as_document(&self) -> Option<Document<'a>> {
1741 if self.key_type() == Value::Document {
1742 let u = self.key();
1743 Some(unsafe { Document::init_from_table(u) })
1747 } else {
1748 None
1749 }
1750 }
1751
1752 #[inline]
1753 #[allow(non_snake_case)]
1754 pub fn key_as_time(&self) -> Option<Time<'a>> {
1755 if self.key_type() == Value::Time {
1756 let u = self.key();
1757 Some(unsafe { Time::init_from_table(u) })
1761 } else {
1762 None
1763 }
1764 }
1765
1766 #[inline]
1767 #[allow(non_snake_case)]
1768 pub fn values_as_null(&self) -> Option<Null<'a>> {
1769 if self.values_type() == Value::Null {
1770 let u = self.values();
1771 Some(unsafe { Null::init_from_table(u) })
1775 } else {
1776 None
1777 }
1778 }
1779
1780 #[inline]
1781 #[allow(non_snake_case)]
1782 pub fn values_as_text(&self) -> Option<Text<'a>> {
1783 if self.values_type() == Value::Text {
1784 let u = self.values();
1785 Some(unsafe { Text::init_from_table(u) })
1789 } else {
1790 None
1791 }
1792 }
1793
1794 #[inline]
1795 #[allow(non_snake_case)]
1796 pub fn values_as_bool(&self) -> Option<Bool<'a>> {
1797 if self.values_type() == Value::Bool {
1798 let u = self.values();
1799 Some(unsafe { Bool::init_from_table(u) })
1803 } else {
1804 None
1805 }
1806 }
1807
1808 #[inline]
1809 #[allow(non_snake_case)]
1810 pub fn values_as_integer(&self) -> Option<Integer<'a>> {
1811 if self.values_type() == Value::Integer {
1812 let u = self.values();
1813 Some(unsafe { Integer::init_from_table(u) })
1817 } else {
1818 None
1819 }
1820 }
1821
1822 #[inline]
1823 #[allow(non_snake_case)]
1824 pub fn values_as_float(&self) -> Option<Float<'a>> {
1825 if self.values_type() == Value::Float {
1826 let u = self.values();
1827 Some(unsafe { Float::init_from_table(u) })
1831 } else {
1832 None
1833 }
1834 }
1835
1836 #[inline]
1837 #[allow(non_snake_case)]
1838 pub fn values_as_list(&self) -> Option<List<'a>> {
1839 if self.values_type() == Value::List {
1840 let u = self.values();
1841 Some(unsafe { List::init_from_table(u) })
1845 } else {
1846 None
1847 }
1848 }
1849
1850 #[inline]
1851 #[allow(non_snake_case)]
1852 pub fn values_as_document(&self) -> Option<Document<'a>> {
1853 if self.values_type() == Value::Document {
1854 let u = self.values();
1855 Some(unsafe { Document::init_from_table(u) })
1859 } else {
1860 None
1861 }
1862 }
1863
1864 #[inline]
1865 #[allow(non_snake_case)]
1866 pub fn values_as_time(&self) -> Option<Time<'a>> {
1867 if self.values_type() == Value::Time {
1868 let u = self.values();
1869 Some(unsafe { Time::init_from_table(u) })
1873 } else {
1874 None
1875 }
1876 }
1877
1878}
1879
1880impl flatbuffers::Verifiable for KeyValue<'_> {
1881 #[inline]
1882 fn run_verifier(
1883 v: &mut flatbuffers::Verifier, pos: usize
1884 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
1885 use self::flatbuffers::Verifiable;
1886 v.visit_table(pos)?
1887 .visit_union::<Value, _>("key_type", Self::VT_KEY_TYPE, "key", Self::VT_KEY, true, |key, v, pos| {
1888 match key {
1889 Value::Null => v.verify_union_variant::<flatbuffers::ForwardsUOffset<Null>>("Value::Null", pos),
1890 Value::Text => v.verify_union_variant::<flatbuffers::ForwardsUOffset<Text>>("Value::Text", pos),
1891 Value::Bool => v.verify_union_variant::<flatbuffers::ForwardsUOffset<Bool>>("Value::Bool", pos),
1892 Value::Integer => v.verify_union_variant::<flatbuffers::ForwardsUOffset<Integer>>("Value::Integer", pos),
1893 Value::Float => v.verify_union_variant::<flatbuffers::ForwardsUOffset<Float>>("Value::Float", pos),
1894 Value::List => v.verify_union_variant::<flatbuffers::ForwardsUOffset<List>>("Value::List", pos),
1895 Value::Document => v.verify_union_variant::<flatbuffers::ForwardsUOffset<Document>>("Value::Document", pos),
1896 Value::Time => v.verify_union_variant::<flatbuffers::ForwardsUOffset<Time>>("Value::Time", pos),
1897 _ => Ok(()),
1898 }
1899 })?
1900 .visit_union::<Value, _>("values_type", Self::VT_VALUES_TYPE, "values", Self::VT_VALUES, true, |key, v, pos| {
1901 match key {
1902 Value::Null => v.verify_union_variant::<flatbuffers::ForwardsUOffset<Null>>("Value::Null", pos),
1903 Value::Text => v.verify_union_variant::<flatbuffers::ForwardsUOffset<Text>>("Value::Text", pos),
1904 Value::Bool => v.verify_union_variant::<flatbuffers::ForwardsUOffset<Bool>>("Value::Bool", pos),
1905 Value::Integer => v.verify_union_variant::<flatbuffers::ForwardsUOffset<Integer>>("Value::Integer", pos),
1906 Value::Float => v.verify_union_variant::<flatbuffers::ForwardsUOffset<Float>>("Value::Float", pos),
1907 Value::List => v.verify_union_variant::<flatbuffers::ForwardsUOffset<List>>("Value::List", pos),
1908 Value::Document => v.verify_union_variant::<flatbuffers::ForwardsUOffset<Document>>("Value::Document", pos),
1909 Value::Time => v.verify_union_variant::<flatbuffers::ForwardsUOffset<Time>>("Value::Time", pos),
1910 _ => Ok(()),
1911 }
1912 })?
1913 .finish();
1914 Ok(())
1915 }
1916}
1917pub struct KeyValueArgs {
1918 pub key_type: Value,
1919 pub key: Option<flatbuffers::WIPOffset<flatbuffers::UnionWIPOffset>>,
1920 pub values_type: Value,
1921 pub values: Option<flatbuffers::WIPOffset<flatbuffers::UnionWIPOffset>>,
1922}
1923impl<'a> Default for KeyValueArgs {
1924 #[inline]
1925 fn default() -> Self {
1926 KeyValueArgs {
1927 key_type: Value::NONE,
1928 key: None, values_type: Value::NONE,
1930 values: None, }
1932 }
1933}
1934
1935pub struct KeyValueBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
1936 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
1937 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
1938}
1939impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> KeyValueBuilder<'a, 'b, A> {
1940 #[inline]
1941 pub fn add_key_type(&mut self, key_type: Value) {
1942 self.fbb_.push_slot::<Value>(KeyValue::VT_KEY_TYPE, key_type, Value::NONE);
1943 }
1944 #[inline]
1945 pub fn add_key(&mut self, key: flatbuffers::WIPOffset<flatbuffers::UnionWIPOffset>) {
1946 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(KeyValue::VT_KEY, key);
1947 }
1948 #[inline]
1949 pub fn add_values_type(&mut self, values_type: Value) {
1950 self.fbb_.push_slot::<Value>(KeyValue::VT_VALUES_TYPE, values_type, Value::NONE);
1951 }
1952 #[inline]
1953 pub fn add_values(&mut self, values: flatbuffers::WIPOffset<flatbuffers::UnionWIPOffset>) {
1954 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(KeyValue::VT_VALUES, values);
1955 }
1956 #[inline]
1957 pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> KeyValueBuilder<'a, 'b, A> {
1958 let start = _fbb.start_table();
1959 KeyValueBuilder {
1960 fbb_: _fbb,
1961 start_: start,
1962 }
1963 }
1964 #[inline]
1965 pub fn finish(self) -> flatbuffers::WIPOffset<KeyValue<'a>> {
1966 let o = self.fbb_.end_table(self.start_);
1967 self.fbb_.required(o, KeyValue::VT_KEY,"key");
1968 self.fbb_.required(o, KeyValue::VT_VALUES,"values");
1969 flatbuffers::WIPOffset::new(o.value())
1970 }
1971}
1972
1973impl core::fmt::Debug for KeyValue<'_> {
1974 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
1975 let mut ds = f.debug_struct("KeyValue");
1976 ds.field("key_type", &self.key_type());
1977 match self.key_type() {
1978 Value::Null => {
1979 if let Some(x) = self.key_as_null() {
1980 ds.field("key", &x)
1981 } else {
1982 ds.field("key", &"InvalidFlatbuffer: Union discriminant does not match value.")
1983 }
1984 },
1985 Value::Text => {
1986 if let Some(x) = self.key_as_text() {
1987 ds.field("key", &x)
1988 } else {
1989 ds.field("key", &"InvalidFlatbuffer: Union discriminant does not match value.")
1990 }
1991 },
1992 Value::Bool => {
1993 if let Some(x) = self.key_as_bool() {
1994 ds.field("key", &x)
1995 } else {
1996 ds.field("key", &"InvalidFlatbuffer: Union discriminant does not match value.")
1997 }
1998 },
1999 Value::Integer => {
2000 if let Some(x) = self.key_as_integer() {
2001 ds.field("key", &x)
2002 } else {
2003 ds.field("key", &"InvalidFlatbuffer: Union discriminant does not match value.")
2004 }
2005 },
2006 Value::Float => {
2007 if let Some(x) = self.key_as_float() {
2008 ds.field("key", &x)
2009 } else {
2010 ds.field("key", &"InvalidFlatbuffer: Union discriminant does not match value.")
2011 }
2012 },
2013 Value::List => {
2014 if let Some(x) = self.key_as_list() {
2015 ds.field("key", &x)
2016 } else {
2017 ds.field("key", &"InvalidFlatbuffer: Union discriminant does not match value.")
2018 }
2019 },
2020 Value::Document => {
2021 if let Some(x) = self.key_as_document() {
2022 ds.field("key", &x)
2023 } else {
2024 ds.field("key", &"InvalidFlatbuffer: Union discriminant does not match value.")
2025 }
2026 },
2027 Value::Time => {
2028 if let Some(x) = self.key_as_time() {
2029 ds.field("key", &x)
2030 } else {
2031 ds.field("key", &"InvalidFlatbuffer: Union discriminant does not match value.")
2032 }
2033 },
2034 _ => {
2035 let x: Option<()> = None;
2036 ds.field("key", &x)
2037 },
2038 };
2039 ds.field("values_type", &self.values_type());
2040 match self.values_type() {
2041 Value::Null => {
2042 if let Some(x) = self.values_as_null() {
2043 ds.field("values", &x)
2044 } else {
2045 ds.field("values", &"InvalidFlatbuffer: Union discriminant does not match value.")
2046 }
2047 },
2048 Value::Text => {
2049 if let Some(x) = self.values_as_text() {
2050 ds.field("values", &x)
2051 } else {
2052 ds.field("values", &"InvalidFlatbuffer: Union discriminant does not match value.")
2053 }
2054 },
2055 Value::Bool => {
2056 if let Some(x) = self.values_as_bool() {
2057 ds.field("values", &x)
2058 } else {
2059 ds.field("values", &"InvalidFlatbuffer: Union discriminant does not match value.")
2060 }
2061 },
2062 Value::Integer => {
2063 if let Some(x) = self.values_as_integer() {
2064 ds.field("values", &x)
2065 } else {
2066 ds.field("values", &"InvalidFlatbuffer: Union discriminant does not match value.")
2067 }
2068 },
2069 Value::Float => {
2070 if let Some(x) = self.values_as_float() {
2071 ds.field("values", &x)
2072 } else {
2073 ds.field("values", &"InvalidFlatbuffer: Union discriminant does not match value.")
2074 }
2075 },
2076 Value::List => {
2077 if let Some(x) = self.values_as_list() {
2078 ds.field("values", &x)
2079 } else {
2080 ds.field("values", &"InvalidFlatbuffer: Union discriminant does not match value.")
2081 }
2082 },
2083 Value::Document => {
2084 if let Some(x) = self.values_as_document() {
2085 ds.field("values", &x)
2086 } else {
2087 ds.field("values", &"InvalidFlatbuffer: Union discriminant does not match value.")
2088 }
2089 },
2090 Value::Time => {
2091 if let Some(x) = self.values_as_time() {
2092 ds.field("values", &x)
2093 } else {
2094 ds.field("values", &"InvalidFlatbuffer: Union discriminant does not match value.")
2095 }
2096 },
2097 _ => {
2098 let x: Option<()> = None;
2099 ds.field("values", &x)
2100 },
2101 };
2102 ds.finish()
2103 }
2104}
2105pub enum DocumentOffset {}
2106#[derive(Copy, Clone, PartialEq)]
2107
2108pub struct Document<'a> {
2109 pub _tab: flatbuffers::Table<'a>,
2110}
2111
2112impl<'a> flatbuffers::Follow<'a> for Document<'a> {
2113 type Inner = Document<'a>;
2114 #[inline]
2115 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
2116 Self { _tab: flatbuffers::Table::new(buf, loc) }
2117 }
2118}
2119
2120impl<'a> Document<'a> {
2121 pub const VT_DATA: flatbuffers::VOffsetT = 4;
2122
2123 #[inline]
2124 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
2125 Document { _tab: table }
2126 }
2127 #[allow(unused_mut)]
2128 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
2129 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
2130 args: &'args DocumentArgs<'args>
2131 ) -> flatbuffers::WIPOffset<Document<'bldr>> {
2132 let mut builder = DocumentBuilder::new(_fbb);
2133 if let Some(x) = args.data { builder.add_data(x); }
2134 builder.finish()
2135 }
2136
2137
2138 #[inline]
2139 pub fn data(&self) -> flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<KeyValue<'a>>> {
2140 unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<KeyValue>>>>(Document::VT_DATA, None).unwrap()}
2144 }
2145}
2146
2147impl flatbuffers::Verifiable for Document<'_> {
2148 #[inline]
2149 fn run_verifier(
2150 v: &mut flatbuffers::Verifier, pos: usize
2151 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
2152 use self::flatbuffers::Verifiable;
2153 v.visit_table(pos)?
2154 .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, flatbuffers::ForwardsUOffset<KeyValue>>>>("data", Self::VT_DATA, true)?
2155 .finish();
2156 Ok(())
2157 }
2158}
2159pub struct DocumentArgs<'a> {
2160 pub data: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<KeyValue<'a>>>>>,
2161}
2162impl<'a> Default for DocumentArgs<'a> {
2163 #[inline]
2164 fn default() -> Self {
2165 DocumentArgs {
2166 data: None, }
2168 }
2169}
2170
2171pub struct DocumentBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
2172 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
2173 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
2174}
2175impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> DocumentBuilder<'a, 'b, A> {
2176 #[inline]
2177 pub fn add_data(&mut self, data: flatbuffers::WIPOffset<flatbuffers::Vector<'b , flatbuffers::ForwardsUOffset<KeyValue<'b >>>>) {
2178 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Document::VT_DATA, data);
2179 }
2180 #[inline]
2181 pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> DocumentBuilder<'a, 'b, A> {
2182 let start = _fbb.start_table();
2183 DocumentBuilder {
2184 fbb_: _fbb,
2185 start_: start,
2186 }
2187 }
2188 #[inline]
2189 pub fn finish(self) -> flatbuffers::WIPOffset<Document<'a>> {
2190 let o = self.fbb_.end_table(self.start_);
2191 self.fbb_.required(o, Document::VT_DATA,"data");
2192 flatbuffers::WIPOffset::new(o.value())
2193 }
2194}
2195
2196impl core::fmt::Debug for Document<'_> {
2197 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
2198 let mut ds = f.debug_struct("Document");
2199 ds.field("data", &self.data());
2200 ds.finish()
2201 }
2202}
2203pub enum TrainOffset {}
2204#[derive(Copy, Clone, PartialEq)]
2205
2206pub struct Train<'a> {
2207 pub _tab: flatbuffers::Table<'a>,
2208}
2209
2210impl<'a> flatbuffers::Follow<'a> for Train<'a> {
2211 type Inner = Train<'a>;
2212 #[inline]
2213 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
2214 Self { _tab: flatbuffers::Table::new(buf, loc) }
2215 }
2216}
2217
2218impl<'a> Train<'a> {
2219 pub const VT_VALUES: flatbuffers::VOffsetT = 4;
2220 pub const VT_TOPIC: flatbuffers::VOffsetT = 6;
2221 pub const VT_EVENT_TIME: flatbuffers::VOffsetT = 8;
2222
2223 #[inline]
2224 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
2225 Train { _tab: table }
2226 }
2227 #[allow(unused_mut)]
2228 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
2229 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
2230 args: &'args TrainArgs<'args>
2231 ) -> flatbuffers::WIPOffset<Train<'bldr>> {
2232 let mut builder = TrainBuilder::new(_fbb);
2233 if let Some(x) = args.event_time { builder.add_event_time(x); }
2234 if let Some(x) = args.topic { builder.add_topic(x); }
2235 if let Some(x) = args.values { builder.add_values(x); }
2236 builder.finish()
2237 }
2238
2239
2240 #[inline]
2241 pub fn values(&self) -> flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<ValueWrapper<'a>>> {
2242 unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<ValueWrapper>>>>(Train::VT_VALUES, None).unwrap()}
2246 }
2247 #[inline]
2248 pub fn topic(&self) -> Option<&'a str> {
2249 unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<&str>>(Train::VT_TOPIC, None)}
2253 }
2254 #[inline]
2255 pub fn event_time(&self) -> Option<Time<'a>> {
2256 unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<Time>>(Train::VT_EVENT_TIME, None)}
2260 }
2261}
2262
2263impl flatbuffers::Verifiable for Train<'_> {
2264 #[inline]
2265 fn run_verifier(
2266 v: &mut flatbuffers::Verifier, pos: usize
2267 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
2268 use self::flatbuffers::Verifiable;
2269 v.visit_table(pos)?
2270 .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, flatbuffers::ForwardsUOffset<ValueWrapper>>>>("values", Self::VT_VALUES, true)?
2271 .visit_field::<flatbuffers::ForwardsUOffset<&str>>("topic", Self::VT_TOPIC, false)?
2272 .visit_field::<flatbuffers::ForwardsUOffset<Time>>("event_time", Self::VT_EVENT_TIME, false)?
2273 .finish();
2274 Ok(())
2275 }
2276}
2277pub struct TrainArgs<'a> {
2278 pub values: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<ValueWrapper<'a>>>>>,
2279 pub topic: Option<flatbuffers::WIPOffset<&'a str>>,
2280 pub event_time: Option<flatbuffers::WIPOffset<Time<'a>>>,
2281}
2282impl<'a> Default for TrainArgs<'a> {
2283 #[inline]
2284 fn default() -> Self {
2285 TrainArgs {
2286 values: None, topic: None,
2288 event_time: None,
2289 }
2290 }
2291}
2292
2293pub struct TrainBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
2294 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
2295 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
2296}
2297impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> TrainBuilder<'a, 'b, A> {
2298 #[inline]
2299 pub fn add_values(&mut self, values: flatbuffers::WIPOffset<flatbuffers::Vector<'b , flatbuffers::ForwardsUOffset<ValueWrapper<'b >>>>) {
2300 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Train::VT_VALUES, values);
2301 }
2302 #[inline]
2303 pub fn add_topic(&mut self, topic: flatbuffers::WIPOffset<&'b str>) {
2304 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Train::VT_TOPIC, topic);
2305 }
2306 #[inline]
2307 pub fn add_event_time(&mut self, event_time: flatbuffers::WIPOffset<Time<'b >>) {
2308 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<Time>>(Train::VT_EVENT_TIME, event_time);
2309 }
2310 #[inline]
2311 pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> TrainBuilder<'a, 'b, A> {
2312 let start = _fbb.start_table();
2313 TrainBuilder {
2314 fbb_: _fbb,
2315 start_: start,
2316 }
2317 }
2318 #[inline]
2319 pub fn finish(self) -> flatbuffers::WIPOffset<Train<'a>> {
2320 let o = self.fbb_.end_table(self.start_);
2321 self.fbb_.required(o, Train::VT_VALUES,"values");
2322 flatbuffers::WIPOffset::new(o.value())
2323 }
2324}
2325
2326impl core::fmt::Debug for Train<'_> {
2327 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
2328 let mut ds = f.debug_struct("Train");
2329 ds.field("values", &self.values());
2330 ds.field("topic", &self.topic());
2331 ds.field("event_time", &self.event_time());
2332 ds.finish()
2333 }
2334}
2335pub enum CatalogOffset {}
2336#[derive(Copy, Clone, PartialEq)]
2337
2338pub struct Catalog<'a> {
2339 pub _tab: flatbuffers::Table<'a>,
2340}
2341
2342impl<'a> flatbuffers::Follow<'a> for Catalog<'a> {
2343 type Inner = Catalog<'a>;
2344 #[inline]
2345 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
2346 Self { _tab: flatbuffers::Table::new(buf, loc) }
2347 }
2348}
2349
2350impl<'a> Catalog<'a> {
2351 pub const VT_PLANS: flatbuffers::VOffsetT = 4;
2352
2353 #[inline]
2354 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
2355 Catalog { _tab: table }
2356 }
2357 #[allow(unused_mut)]
2358 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
2359 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
2360 args: &'args CatalogArgs<'args>
2361 ) -> flatbuffers::WIPOffset<Catalog<'bldr>> {
2362 let mut builder = CatalogBuilder::new(_fbb);
2363 if let Some(x) = args.plans { builder.add_plans(x); }
2364 builder.finish()
2365 }
2366
2367
2368 #[inline]
2369 pub fn plans(&self) -> Option<Plans<'a>> {
2370 unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<Plans>>(Catalog::VT_PLANS, None)}
2374 }
2375}
2376
2377impl flatbuffers::Verifiable for Catalog<'_> {
2378 #[inline]
2379 fn run_verifier(
2380 v: &mut flatbuffers::Verifier, pos: usize
2381 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
2382 use self::flatbuffers::Verifiable;
2383 v.visit_table(pos)?
2384 .visit_field::<flatbuffers::ForwardsUOffset<Plans>>("plans", Self::VT_PLANS, false)?
2385 .finish();
2386 Ok(())
2387 }
2388}
2389pub struct CatalogArgs<'a> {
2390 pub plans: Option<flatbuffers::WIPOffset<Plans<'a>>>,
2391}
2392impl<'a> Default for CatalogArgs<'a> {
2393 #[inline]
2394 fn default() -> Self {
2395 CatalogArgs {
2396 plans: None,
2397 }
2398 }
2399}
2400
2401pub struct CatalogBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
2402 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
2403 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
2404}
2405impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> CatalogBuilder<'a, 'b, A> {
2406 #[inline]
2407 pub fn add_plans(&mut self, plans: flatbuffers::WIPOffset<Plans<'b >>) {
2408 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<Plans>>(Catalog::VT_PLANS, plans);
2409 }
2410 #[inline]
2411 pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> CatalogBuilder<'a, 'b, A> {
2412 let start = _fbb.start_table();
2413 CatalogBuilder {
2414 fbb_: _fbb,
2415 start_: start,
2416 }
2417 }
2418 #[inline]
2419 pub fn finish(self) -> flatbuffers::WIPOffset<Catalog<'a>> {
2420 let o = self.fbb_.end_table(self.start_);
2421 flatbuffers::WIPOffset::new(o.value())
2422 }
2423}
2424
2425impl core::fmt::Debug for Catalog<'_> {
2426 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
2427 let mut ds = f.debug_struct("Catalog");
2428 ds.field("plans", &self.plans());
2429 ds.finish()
2430 }
2431}
2432pub enum StationOffset {}
2433#[derive(Copy, Clone, PartialEq)]
2434
2435pub struct Station<'a> {
2436 pub _tab: flatbuffers::Table<'a>,
2437}
2438
2439impl<'a> flatbuffers::Follow<'a> for Station<'a> {
2440 type Inner = Station<'a>;
2441 #[inline]
2442 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
2443 Self { _tab: flatbuffers::Table::new(buf, loc) }
2444 }
2445}
2446
2447impl<'a> Station<'a> {
2448 pub const VT_ID: flatbuffers::VOffsetT = 4;
2449 pub const VT_STOP: flatbuffers::VOffsetT = 6;
2450 pub const VT_TRANSFORM: flatbuffers::VOffsetT = 8;
2451 pub const VT_BLOCK: flatbuffers::VOffsetT = 10;
2452 pub const VT_INPUTS: flatbuffers::VOffsetT = 12;
2453
2454 #[inline]
2455 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
2456 Station { _tab: table }
2457 }
2458 #[allow(unused_mut)]
2459 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
2460 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
2461 args: &'args StationArgs<'args>
2462 ) -> flatbuffers::WIPOffset<Station<'bldr>> {
2463 let mut builder = StationBuilder::new(_fbb);
2464 builder.add_stop(args.stop);
2465 builder.add_id(args.id);
2466 if let Some(x) = args.inputs { builder.add_inputs(x); }
2467 if let Some(x) = args.block { builder.add_block(x); }
2468 if let Some(x) = args.transform { builder.add_transform(x); }
2469 builder.finish()
2470 }
2471
2472
2473 #[inline]
2474 pub fn id(&self) -> u64 {
2475 unsafe { self._tab.get::<u64>(Station::VT_ID, Some(0)).unwrap()}
2479 }
2480 #[inline]
2481 pub fn stop(&self) -> u64 {
2482 unsafe { self._tab.get::<u64>(Station::VT_STOP, Some(0)).unwrap()}
2486 }
2487 #[inline]
2488 pub fn transform(&self) -> Option<Transform<'a>> {
2489 unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<Transform>>(Station::VT_TRANSFORM, None)}
2493 }
2494 #[inline]
2495 pub fn block(&self) -> Option<flatbuffers::Vector<'a, u64>> {
2496 unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, u64>>>(Station::VT_BLOCK, None)}
2500 }
2501 #[inline]
2502 pub fn inputs(&self) -> Option<flatbuffers::Vector<'a, u64>> {
2503 unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, u64>>>(Station::VT_INPUTS, None)}
2507 }
2508}
2509
2510impl flatbuffers::Verifiable for Station<'_> {
2511 #[inline]
2512 fn run_verifier(
2513 v: &mut flatbuffers::Verifier, pos: usize
2514 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
2515 use self::flatbuffers::Verifiable;
2516 v.visit_table(pos)?
2517 .visit_field::<u64>("id", Self::VT_ID, false)?
2518 .visit_field::<u64>("stop", Self::VT_STOP, false)?
2519 .visit_field::<flatbuffers::ForwardsUOffset<Transform>>("transform", Self::VT_TRANSFORM, false)?
2520 .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, u64>>>("block", Self::VT_BLOCK, false)?
2521 .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, u64>>>("inputs", Self::VT_INPUTS, false)?
2522 .finish();
2523 Ok(())
2524 }
2525}
2526pub struct StationArgs<'a> {
2527 pub id: u64,
2528 pub stop: u64,
2529 pub transform: Option<flatbuffers::WIPOffset<Transform<'a>>>,
2530 pub block: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, u64>>>,
2531 pub inputs: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, u64>>>,
2532}
2533impl<'a> Default for StationArgs<'a> {
2534 #[inline]
2535 fn default() -> Self {
2536 StationArgs {
2537 id: 0,
2538 stop: 0,
2539 transform: None,
2540 block: None,
2541 inputs: None,
2542 }
2543 }
2544}
2545
2546pub struct StationBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
2547 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
2548 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
2549}
2550impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> StationBuilder<'a, 'b, A> {
2551 #[inline]
2552 pub fn add_id(&mut self, id: u64) {
2553 self.fbb_.push_slot::<u64>(Station::VT_ID, id, 0);
2554 }
2555 #[inline]
2556 pub fn add_stop(&mut self, stop: u64) {
2557 self.fbb_.push_slot::<u64>(Station::VT_STOP, stop, 0);
2558 }
2559 #[inline]
2560 pub fn add_transform(&mut self, transform: flatbuffers::WIPOffset<Transform<'b >>) {
2561 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<Transform>>(Station::VT_TRANSFORM, transform);
2562 }
2563 #[inline]
2564 pub fn add_block(&mut self, block: flatbuffers::WIPOffset<flatbuffers::Vector<'b , u64>>) {
2565 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Station::VT_BLOCK, block);
2566 }
2567 #[inline]
2568 pub fn add_inputs(&mut self, inputs: flatbuffers::WIPOffset<flatbuffers::Vector<'b , u64>>) {
2569 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Station::VT_INPUTS, inputs);
2570 }
2571 #[inline]
2572 pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> StationBuilder<'a, 'b, A> {
2573 let start = _fbb.start_table();
2574 StationBuilder {
2575 fbb_: _fbb,
2576 start_: start,
2577 }
2578 }
2579 #[inline]
2580 pub fn finish(self) -> flatbuffers::WIPOffset<Station<'a>> {
2581 let o = self.fbb_.end_table(self.start_);
2582 flatbuffers::WIPOffset::new(o.value())
2583 }
2584}
2585
2586impl core::fmt::Debug for Station<'_> {
2587 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
2588 let mut ds = f.debug_struct("Station");
2589 ds.field("id", &self.id());
2590 ds.field("stop", &self.stop());
2591 ds.field("transform", &self.transform());
2592 ds.field("block", &self.block());
2593 ds.field("inputs", &self.inputs());
2594 ds.finish()
2595 }
2596}
2597pub enum LanguageTransformOffset {}
2598#[derive(Copy, Clone, PartialEq)]
2599
2600pub struct LanguageTransform<'a> {
2601 pub _tab: flatbuffers::Table<'a>,
2602}
2603
2604impl<'a> flatbuffers::Follow<'a> for LanguageTransform<'a> {
2605 type Inner = LanguageTransform<'a>;
2606 #[inline]
2607 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
2608 Self { _tab: flatbuffers::Table::new(buf, loc) }
2609 }
2610}
2611
2612impl<'a> LanguageTransform<'a> {
2613 pub const VT_LANGUAGE: flatbuffers::VOffsetT = 4;
2614 pub const VT_QUERY: flatbuffers::VOffsetT = 6;
2615
2616 #[inline]
2617 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
2618 LanguageTransform { _tab: table }
2619 }
2620 #[allow(unused_mut)]
2621 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
2622 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
2623 args: &'args LanguageTransformArgs<'args>
2624 ) -> flatbuffers::WIPOffset<LanguageTransform<'bldr>> {
2625 let mut builder = LanguageTransformBuilder::new(_fbb);
2626 if let Some(x) = args.query { builder.add_query(x); }
2627 if let Some(x) = args.language { builder.add_language(x); }
2628 builder.finish()
2629 }
2630
2631
2632 #[inline]
2633 pub fn language(&self) -> Option<&'a str> {
2634 unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<&str>>(LanguageTransform::VT_LANGUAGE, None)}
2638 }
2639 #[inline]
2640 pub fn query(&self) -> Option<&'a str> {
2641 unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<&str>>(LanguageTransform::VT_QUERY, None)}
2645 }
2646}
2647
2648impl flatbuffers::Verifiable for LanguageTransform<'_> {
2649 #[inline]
2650 fn run_verifier(
2651 v: &mut flatbuffers::Verifier, pos: usize
2652 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
2653 use self::flatbuffers::Verifiable;
2654 v.visit_table(pos)?
2655 .visit_field::<flatbuffers::ForwardsUOffset<&str>>("language", Self::VT_LANGUAGE, false)?
2656 .visit_field::<flatbuffers::ForwardsUOffset<&str>>("query", Self::VT_QUERY, false)?
2657 .finish();
2658 Ok(())
2659 }
2660}
2661pub struct LanguageTransformArgs<'a> {
2662 pub language: Option<flatbuffers::WIPOffset<&'a str>>,
2663 pub query: Option<flatbuffers::WIPOffset<&'a str>>,
2664}
2665impl<'a> Default for LanguageTransformArgs<'a> {
2666 #[inline]
2667 fn default() -> Self {
2668 LanguageTransformArgs {
2669 language: None,
2670 query: None,
2671 }
2672 }
2673}
2674
2675pub struct LanguageTransformBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
2676 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
2677 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
2678}
2679impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> LanguageTransformBuilder<'a, 'b, A> {
2680 #[inline]
2681 pub fn add_language(&mut self, language: flatbuffers::WIPOffset<&'b str>) {
2682 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(LanguageTransform::VT_LANGUAGE, language);
2683 }
2684 #[inline]
2685 pub fn add_query(&mut self, query: flatbuffers::WIPOffset<&'b str>) {
2686 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(LanguageTransform::VT_QUERY, query);
2687 }
2688 #[inline]
2689 pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> LanguageTransformBuilder<'a, 'b, A> {
2690 let start = _fbb.start_table();
2691 LanguageTransformBuilder {
2692 fbb_: _fbb,
2693 start_: start,
2694 }
2695 }
2696 #[inline]
2697 pub fn finish(self) -> flatbuffers::WIPOffset<LanguageTransform<'a>> {
2698 let o = self.fbb_.end_table(self.start_);
2699 flatbuffers::WIPOffset::new(o.value())
2700 }
2701}
2702
2703impl core::fmt::Debug for LanguageTransform<'_> {
2704 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
2705 let mut ds = f.debug_struct("LanguageTransform");
2706 ds.field("language", &self.language());
2707 ds.field("query", &self.query());
2708 ds.finish()
2709 }
2710}
2711pub enum TransformOffset {}
2712#[derive(Copy, Clone, PartialEq)]
2713
2714pub struct Transform<'a> {
2715 pub _tab: flatbuffers::Table<'a>,
2716}
2717
2718impl<'a> flatbuffers::Follow<'a> for Transform<'a> {
2719 type Inner = Transform<'a>;
2720 #[inline]
2721 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
2722 Self { _tab: flatbuffers::Table::new(buf, loc) }
2723 }
2724}
2725
2726impl<'a> Transform<'a> {
2727 pub const VT_NAME: flatbuffers::VOffsetT = 4;
2728 pub const VT_TYPE_TYPE: flatbuffers::VOffsetT = 6;
2729 pub const VT_TYPE_: flatbuffers::VOffsetT = 8;
2730
2731 #[inline]
2732 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
2733 Transform { _tab: table }
2734 }
2735 #[allow(unused_mut)]
2736 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
2737 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
2738 args: &'args TransformArgs<'args>
2739 ) -> flatbuffers::WIPOffset<Transform<'bldr>> {
2740 let mut builder = TransformBuilder::new(_fbb);
2741 if let Some(x) = args.type_ { builder.add_type_(x); }
2742 if let Some(x) = args.name { builder.add_name(x); }
2743 builder.add_type_type(args.type_type);
2744 builder.finish()
2745 }
2746
2747
2748 #[inline]
2749 pub fn name(&self) -> Option<&'a str> {
2750 unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<&str>>(Transform::VT_NAME, None)}
2754 }
2755 #[inline]
2756 pub fn type_type(&self) -> TransformType {
2757 unsafe { self._tab.get::<TransformType>(Transform::VT_TYPE_TYPE, Some(TransformType::NONE)).unwrap()}
2761 }
2762 #[inline]
2763 pub fn type_(&self) -> Option<flatbuffers::Table<'a>> {
2764 unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Table<'a>>>(Transform::VT_TYPE_, None)}
2768 }
2769 #[inline]
2770 #[allow(non_snake_case)]
2771 pub fn type__as_language_transform(&self) -> Option<LanguageTransform<'a>> {
2772 if self.type_type() == TransformType::LanguageTransform {
2773 self.type_().map(|t| {
2774 unsafe { LanguageTransform::init_from_table(t) }
2778 })
2779 } else {
2780 None
2781 }
2782 }
2783
2784}
2785
2786impl flatbuffers::Verifiable for Transform<'_> {
2787 #[inline]
2788 fn run_verifier(
2789 v: &mut flatbuffers::Verifier, pos: usize
2790 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
2791 use self::flatbuffers::Verifiable;
2792 v.visit_table(pos)?
2793 .visit_field::<flatbuffers::ForwardsUOffset<&str>>("name", Self::VT_NAME, false)?
2794 .visit_union::<TransformType, _>("type_type", Self::VT_TYPE_TYPE, "type_", Self::VT_TYPE_, false, |key, v, pos| {
2795 match key {
2796 TransformType::LanguageTransform => v.verify_union_variant::<flatbuffers::ForwardsUOffset<LanguageTransform>>("TransformType::LanguageTransform", pos),
2797 _ => Ok(()),
2798 }
2799 })?
2800 .finish();
2801 Ok(())
2802 }
2803}
2804pub struct TransformArgs<'a> {
2805 pub name: Option<flatbuffers::WIPOffset<&'a str>>,
2806 pub type_type: TransformType,
2807 pub type_: Option<flatbuffers::WIPOffset<flatbuffers::UnionWIPOffset>>,
2808}
2809impl<'a> Default for TransformArgs<'a> {
2810 #[inline]
2811 fn default() -> Self {
2812 TransformArgs {
2813 name: None,
2814 type_type: TransformType::NONE,
2815 type_: None,
2816 }
2817 }
2818}
2819
2820pub struct TransformBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
2821 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
2822 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
2823}
2824impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> TransformBuilder<'a, 'b, A> {
2825 #[inline]
2826 pub fn add_name(&mut self, name: flatbuffers::WIPOffset<&'b str>) {
2827 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Transform::VT_NAME, name);
2828 }
2829 #[inline]
2830 pub fn add_type_type(&mut self, type_type: TransformType) {
2831 self.fbb_.push_slot::<TransformType>(Transform::VT_TYPE_TYPE, type_type, TransformType::NONE);
2832 }
2833 #[inline]
2834 pub fn add_type_(&mut self, type_: flatbuffers::WIPOffset<flatbuffers::UnionWIPOffset>) {
2835 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Transform::VT_TYPE_, type_);
2836 }
2837 #[inline]
2838 pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> TransformBuilder<'a, 'b, A> {
2839 let start = _fbb.start_table();
2840 TransformBuilder {
2841 fbb_: _fbb,
2842 start_: start,
2843 }
2844 }
2845 #[inline]
2846 pub fn finish(self) -> flatbuffers::WIPOffset<Transform<'a>> {
2847 let o = self.fbb_.end_table(self.start_);
2848 flatbuffers::WIPOffset::new(o.value())
2849 }
2850}
2851
2852impl core::fmt::Debug for Transform<'_> {
2853 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
2854 let mut ds = f.debug_struct("Transform");
2855 ds.field("name", &self.name());
2856 ds.field("type_type", &self.type_type());
2857 match self.type_type() {
2858 TransformType::LanguageTransform => {
2859 if let Some(x) = self.type__as_language_transform() {
2860 ds.field("type_", &x)
2861 } else {
2862 ds.field("type_", &"InvalidFlatbuffer: Union discriminant does not match value.")
2863 }
2864 },
2865 _ => {
2866 let x: Option<()> = None;
2867 ds.field("type_", &x)
2868 },
2869 };
2870 ds.finish()
2871 }
2872}
2873pub enum KeyValueU64VecU64Offset {}
2874#[derive(Copy, Clone, PartialEq)]
2875
2876pub struct KeyValueU64VecU64<'a> {
2877 pub _tab: flatbuffers::Table<'a>,
2878}
2879
2880impl<'a> flatbuffers::Follow<'a> for KeyValueU64VecU64<'a> {
2881 type Inner = KeyValueU64VecU64<'a>;
2882 #[inline]
2883 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
2884 Self { _tab: flatbuffers::Table::new(buf, loc) }
2885 }
2886}
2887
2888impl<'a> KeyValueU64VecU64<'a> {
2889 pub const VT_KEY: flatbuffers::VOffsetT = 4;
2890 pub const VT_VALUE: flatbuffers::VOffsetT = 6;
2891
2892 #[inline]
2893 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
2894 KeyValueU64VecU64 { _tab: table }
2895 }
2896 #[allow(unused_mut)]
2897 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
2898 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
2899 args: &'args KeyValueU64VecU64Args<'args>
2900 ) -> flatbuffers::WIPOffset<KeyValueU64VecU64<'bldr>> {
2901 let mut builder = KeyValueU64VecU64Builder::new(_fbb);
2902 builder.add_key(args.key);
2903 if let Some(x) = args.value { builder.add_value(x); }
2904 builder.finish()
2905 }
2906
2907
2908 #[inline]
2909 pub fn key(&self) -> u64 {
2910 unsafe { self._tab.get::<u64>(KeyValueU64VecU64::VT_KEY, Some(0)).unwrap()}
2914 }
2915 #[inline]
2916 pub fn value(&self) -> Option<flatbuffers::Vector<'a, u64>> {
2917 unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, u64>>>(KeyValueU64VecU64::VT_VALUE, None)}
2921 }
2922}
2923
2924impl flatbuffers::Verifiable for KeyValueU64VecU64<'_> {
2925 #[inline]
2926 fn run_verifier(
2927 v: &mut flatbuffers::Verifier, pos: usize
2928 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
2929 use self::flatbuffers::Verifiable;
2930 v.visit_table(pos)?
2931 .visit_field::<u64>("key", Self::VT_KEY, false)?
2932 .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, u64>>>("value", Self::VT_VALUE, false)?
2933 .finish();
2934 Ok(())
2935 }
2936}
2937pub struct KeyValueU64VecU64Args<'a> {
2938 pub key: u64,
2939 pub value: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, u64>>>,
2940}
2941impl<'a> Default for KeyValueU64VecU64Args<'a> {
2942 #[inline]
2943 fn default() -> Self {
2944 KeyValueU64VecU64Args {
2945 key: 0,
2946 value: None,
2947 }
2948 }
2949}
2950
2951pub struct KeyValueU64VecU64Builder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
2952 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
2953 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
2954}
2955impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> KeyValueU64VecU64Builder<'a, 'b, A> {
2956 #[inline]
2957 pub fn add_key(&mut self, key: u64) {
2958 self.fbb_.push_slot::<u64>(KeyValueU64VecU64::VT_KEY, key, 0);
2959 }
2960 #[inline]
2961 pub fn add_value(&mut self, value: flatbuffers::WIPOffset<flatbuffers::Vector<'b , u64>>) {
2962 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(KeyValueU64VecU64::VT_VALUE, value);
2963 }
2964 #[inline]
2965 pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> KeyValueU64VecU64Builder<'a, 'b, A> {
2966 let start = _fbb.start_table();
2967 KeyValueU64VecU64Builder {
2968 fbb_: _fbb,
2969 start_: start,
2970 }
2971 }
2972 #[inline]
2973 pub fn finish(self) -> flatbuffers::WIPOffset<KeyValueU64VecU64<'a>> {
2974 let o = self.fbb_.end_table(self.start_);
2975 flatbuffers::WIPOffset::new(o.value())
2976 }
2977}
2978
2979impl core::fmt::Debug for KeyValueU64VecU64<'_> {
2980 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
2981 let mut ds = f.debug_struct("KeyValueU64VecU64");
2982 ds.field("key", &self.key());
2983 ds.field("value", &self.value());
2984 ds.finish()
2985 }
2986}
2987pub enum KeyValueU64StationOffset {}
2988#[derive(Copy, Clone, PartialEq)]
2989
2990pub struct KeyValueU64Station<'a> {
2991 pub _tab: flatbuffers::Table<'a>,
2992}
2993
2994impl<'a> flatbuffers::Follow<'a> for KeyValueU64Station<'a> {
2995 type Inner = KeyValueU64Station<'a>;
2996 #[inline]
2997 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
2998 Self { _tab: flatbuffers::Table::new(buf, loc) }
2999 }
3000}
3001
3002impl<'a> KeyValueU64Station<'a> {
3003 pub const VT_KEY: flatbuffers::VOffsetT = 4;
3004 pub const VT_VALUE: flatbuffers::VOffsetT = 6;
3005
3006 #[inline]
3007 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
3008 KeyValueU64Station { _tab: table }
3009 }
3010 #[allow(unused_mut)]
3011 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
3012 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
3013 args: &'args KeyValueU64StationArgs<'args>
3014 ) -> flatbuffers::WIPOffset<KeyValueU64Station<'bldr>> {
3015 let mut builder = KeyValueU64StationBuilder::new(_fbb);
3016 builder.add_key(args.key);
3017 if let Some(x) = args.value { builder.add_value(x); }
3018 builder.finish()
3019 }
3020
3021
3022 #[inline]
3023 pub fn key(&self) -> u64 {
3024 unsafe { self._tab.get::<u64>(KeyValueU64Station::VT_KEY, Some(0)).unwrap()}
3028 }
3029 #[inline]
3030 pub fn value(&self) -> Option<Station<'a>> {
3031 unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<Station>>(KeyValueU64Station::VT_VALUE, None)}
3035 }
3036}
3037
3038impl flatbuffers::Verifiable for KeyValueU64Station<'_> {
3039 #[inline]
3040 fn run_verifier(
3041 v: &mut flatbuffers::Verifier, pos: usize
3042 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
3043 use self::flatbuffers::Verifiable;
3044 v.visit_table(pos)?
3045 .visit_field::<u64>("key", Self::VT_KEY, false)?
3046 .visit_field::<flatbuffers::ForwardsUOffset<Station>>("value", Self::VT_VALUE, false)?
3047 .finish();
3048 Ok(())
3049 }
3050}
3051pub struct KeyValueU64StationArgs<'a> {
3052 pub key: u64,
3053 pub value: Option<flatbuffers::WIPOffset<Station<'a>>>,
3054}
3055impl<'a> Default for KeyValueU64StationArgs<'a> {
3056 #[inline]
3057 fn default() -> Self {
3058 KeyValueU64StationArgs {
3059 key: 0,
3060 value: None,
3061 }
3062 }
3063}
3064
3065pub struct KeyValueU64StationBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
3066 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
3067 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
3068}
3069impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> KeyValueU64StationBuilder<'a, 'b, A> {
3070 #[inline]
3071 pub fn add_key(&mut self, key: u64) {
3072 self.fbb_.push_slot::<u64>(KeyValueU64Station::VT_KEY, key, 0);
3073 }
3074 #[inline]
3075 pub fn add_value(&mut self, value: flatbuffers::WIPOffset<Station<'b >>) {
3076 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<Station>>(KeyValueU64Station::VT_VALUE, value);
3077 }
3078 #[inline]
3079 pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> KeyValueU64StationBuilder<'a, 'b, A> {
3080 let start = _fbb.start_table();
3081 KeyValueU64StationBuilder {
3082 fbb_: _fbb,
3083 start_: start,
3084 }
3085 }
3086 #[inline]
3087 pub fn finish(self) -> flatbuffers::WIPOffset<KeyValueU64Station<'a>> {
3088 let o = self.fbb_.end_table(self.start_);
3089 flatbuffers::WIPOffset::new(o.value())
3090 }
3091}
3092
3093impl core::fmt::Debug for KeyValueU64Station<'_> {
3094 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
3095 let mut ds = f.debug_struct("KeyValueU64Station");
3096 ds.field("key", &self.key());
3097 ds.field("value", &self.value());
3098 ds.finish()
3099 }
3100}
3101pub enum KeyValueStringTransformOffset {}
3102#[derive(Copy, Clone, PartialEq)]
3103
3104pub struct KeyValueStringTransform<'a> {
3105 pub _tab: flatbuffers::Table<'a>,
3106}
3107
3108impl<'a> flatbuffers::Follow<'a> for KeyValueStringTransform<'a> {
3109 type Inner = KeyValueStringTransform<'a>;
3110 #[inline]
3111 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
3112 Self { _tab: flatbuffers::Table::new(buf, loc) }
3113 }
3114}
3115
3116impl<'a> KeyValueStringTransform<'a> {
3117 pub const VT_KEY: flatbuffers::VOffsetT = 4;
3118 pub const VT_VALUE: flatbuffers::VOffsetT = 6;
3119
3120 #[inline]
3121 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
3122 KeyValueStringTransform { _tab: table }
3123 }
3124 #[allow(unused_mut)]
3125 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
3126 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
3127 args: &'args KeyValueStringTransformArgs<'args>
3128 ) -> flatbuffers::WIPOffset<KeyValueStringTransform<'bldr>> {
3129 let mut builder = KeyValueStringTransformBuilder::new(_fbb);
3130 if let Some(x) = args.value { builder.add_value(x); }
3131 if let Some(x) = args.key { builder.add_key(x); }
3132 builder.finish()
3133 }
3134
3135
3136 #[inline]
3137 pub fn key(&self) -> &'a str {
3138 unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<&str>>(KeyValueStringTransform::VT_KEY, None).unwrap()}
3142 }
3143 #[inline]
3144 pub fn value(&self) -> Transform<'a> {
3145 unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<Transform>>(KeyValueStringTransform::VT_VALUE, None).unwrap()}
3149 }
3150}
3151
3152impl flatbuffers::Verifiable for KeyValueStringTransform<'_> {
3153 #[inline]
3154 fn run_verifier(
3155 v: &mut flatbuffers::Verifier, pos: usize
3156 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
3157 use self::flatbuffers::Verifiable;
3158 v.visit_table(pos)?
3159 .visit_field::<flatbuffers::ForwardsUOffset<&str>>("key", Self::VT_KEY, true)?
3160 .visit_field::<flatbuffers::ForwardsUOffset<Transform>>("value", Self::VT_VALUE, true)?
3161 .finish();
3162 Ok(())
3163 }
3164}
3165pub struct KeyValueStringTransformArgs<'a> {
3166 pub key: Option<flatbuffers::WIPOffset<&'a str>>,
3167 pub value: Option<flatbuffers::WIPOffset<Transform<'a>>>,
3168}
3169impl<'a> Default for KeyValueStringTransformArgs<'a> {
3170 #[inline]
3171 fn default() -> Self {
3172 KeyValueStringTransformArgs {
3173 key: None, value: None, }
3176 }
3177}
3178
3179pub struct KeyValueStringTransformBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
3180 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
3181 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
3182}
3183impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> KeyValueStringTransformBuilder<'a, 'b, A> {
3184 #[inline]
3185 pub fn add_key(&mut self, key: flatbuffers::WIPOffset<&'b str>) {
3186 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(KeyValueStringTransform::VT_KEY, key);
3187 }
3188 #[inline]
3189 pub fn add_value(&mut self, value: flatbuffers::WIPOffset<Transform<'b >>) {
3190 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<Transform>>(KeyValueStringTransform::VT_VALUE, value);
3191 }
3192 #[inline]
3193 pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> KeyValueStringTransformBuilder<'a, 'b, A> {
3194 let start = _fbb.start_table();
3195 KeyValueStringTransformBuilder {
3196 fbb_: _fbb,
3197 start_: start,
3198 }
3199 }
3200 #[inline]
3201 pub fn finish(self) -> flatbuffers::WIPOffset<KeyValueStringTransform<'a>> {
3202 let o = self.fbb_.end_table(self.start_);
3203 self.fbb_.required(o, KeyValueStringTransform::VT_KEY,"key");
3204 self.fbb_.required(o, KeyValueStringTransform::VT_VALUE,"value");
3205 flatbuffers::WIPOffset::new(o.value())
3206 }
3207}
3208
3209impl core::fmt::Debug for KeyValueStringTransform<'_> {
3210 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
3211 let mut ds = f.debug_struct("KeyValueStringTransform");
3212 ds.field("key", &self.key());
3213 ds.field("value", &self.value());
3214 ds.finish()
3215 }
3216}
3217pub enum SourceOffset {}
3218#[derive(Copy, Clone, PartialEq)]
3219
3220pub struct Source<'a> {
3221 pub _tab: flatbuffers::Table<'a>,
3222}
3223
3224impl<'a> flatbuffers::Follow<'a> for Source<'a> {
3225 type Inner = Source<'a>;
3226 #[inline]
3227 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
3228 Self { _tab: flatbuffers::Table::new(buf, loc) }
3229 }
3230}
3231
3232impl<'a> Source<'a> {
3233 pub const VT_ID: flatbuffers::VOffsetT = 4;
3234 pub const VT_NAME: flatbuffers::VOffsetT = 6;
3235 pub const VT_TYPE_: flatbuffers::VOffsetT = 8;
3236
3237 #[inline]
3238 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
3239 Source { _tab: table }
3240 }
3241 #[allow(unused_mut)]
3242 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
3243 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
3244 args: &'args SourceArgs<'args>
3245 ) -> flatbuffers::WIPOffset<Source<'bldr>> {
3246 let mut builder = SourceBuilder::new(_fbb);
3247 builder.add_id(args.id);
3248 if let Some(x) = args.type_ { builder.add_type_(x); }
3249 if let Some(x) = args.name { builder.add_name(x); }
3250 builder.finish()
3251 }
3252
3253
3254 #[inline]
3255 pub fn id(&self) -> u64 {
3256 unsafe { self._tab.get::<u64>(Source::VT_ID, Some(0)).unwrap()}
3260 }
3261 #[inline]
3262 pub fn name(&self) -> &'a str {
3263 unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<&str>>(Source::VT_NAME, None).unwrap()}
3267 }
3268 #[inline]
3269 pub fn type_(&self) -> &'a str {
3270 unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<&str>>(Source::VT_TYPE_, None).unwrap()}
3274 }
3275}
3276
3277impl flatbuffers::Verifiable for Source<'_> {
3278 #[inline]
3279 fn run_verifier(
3280 v: &mut flatbuffers::Verifier, pos: usize
3281 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
3282 use self::flatbuffers::Verifiable;
3283 v.visit_table(pos)?
3284 .visit_field::<u64>("id", Self::VT_ID, false)?
3285 .visit_field::<flatbuffers::ForwardsUOffset<&str>>("name", Self::VT_NAME, true)?
3286 .visit_field::<flatbuffers::ForwardsUOffset<&str>>("type_", Self::VT_TYPE_, true)?
3287 .finish();
3288 Ok(())
3289 }
3290}
3291pub struct SourceArgs<'a> {
3292 pub id: u64,
3293 pub name: Option<flatbuffers::WIPOffset<&'a str>>,
3294 pub type_: Option<flatbuffers::WIPOffset<&'a str>>,
3295}
3296impl<'a> Default for SourceArgs<'a> {
3297 #[inline]
3298 fn default() -> Self {
3299 SourceArgs {
3300 id: 0,
3301 name: None, type_: None, }
3304 }
3305}
3306
3307pub struct SourceBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
3308 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
3309 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
3310}
3311impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> SourceBuilder<'a, 'b, A> {
3312 #[inline]
3313 pub fn add_id(&mut self, id: u64) {
3314 self.fbb_.push_slot::<u64>(Source::VT_ID, id, 0);
3315 }
3316 #[inline]
3317 pub fn add_name(&mut self, name: flatbuffers::WIPOffset<&'b str>) {
3318 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Source::VT_NAME, name);
3319 }
3320 #[inline]
3321 pub fn add_type_(&mut self, type_: flatbuffers::WIPOffset<&'b str>) {
3322 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Source::VT_TYPE_, type_);
3323 }
3324 #[inline]
3325 pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> SourceBuilder<'a, 'b, A> {
3326 let start = _fbb.start_table();
3327 SourceBuilder {
3328 fbb_: _fbb,
3329 start_: start,
3330 }
3331 }
3332 #[inline]
3333 pub fn finish(self) -> flatbuffers::WIPOffset<Source<'a>> {
3334 let o = self.fbb_.end_table(self.start_);
3335 self.fbb_.required(o, Source::VT_NAME,"name");
3336 self.fbb_.required(o, Source::VT_TYPE_,"type_");
3337 flatbuffers::WIPOffset::new(o.value())
3338 }
3339}
3340
3341impl core::fmt::Debug for Source<'_> {
3342 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
3343 let mut ds = f.debug_struct("Source");
3344 ds.field("id", &self.id());
3345 ds.field("name", &self.name());
3346 ds.field("type_", &self.type_());
3347 ds.finish()
3348 }
3349}
3350pub enum DestinationOffset {}
3351#[derive(Copy, Clone, PartialEq)]
3352
3353pub struct Destination<'a> {
3354 pub _tab: flatbuffers::Table<'a>,
3355}
3356
3357impl<'a> flatbuffers::Follow<'a> for Destination<'a> {
3358 type Inner = Destination<'a>;
3359 #[inline]
3360 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
3361 Self { _tab: flatbuffers::Table::new(buf, loc) }
3362 }
3363}
3364
3365impl<'a> Destination<'a> {
3366 pub const VT_ID: flatbuffers::VOffsetT = 4;
3367 pub const VT_NAME: flatbuffers::VOffsetT = 6;
3368 pub const VT_TYPE_: flatbuffers::VOffsetT = 8;
3369
3370 #[inline]
3371 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
3372 Destination { _tab: table }
3373 }
3374 #[allow(unused_mut)]
3375 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
3376 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
3377 args: &'args DestinationArgs<'args>
3378 ) -> flatbuffers::WIPOffset<Destination<'bldr>> {
3379 let mut builder = DestinationBuilder::new(_fbb);
3380 builder.add_id(args.id);
3381 if let Some(x) = args.type_ { builder.add_type_(x); }
3382 if let Some(x) = args.name { builder.add_name(x); }
3383 builder.finish()
3384 }
3385
3386
3387 #[inline]
3388 pub fn id(&self) -> u64 {
3389 unsafe { self._tab.get::<u64>(Destination::VT_ID, Some(0)).unwrap()}
3393 }
3394 #[inline]
3395 pub fn name(&self) -> &'a str {
3396 unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<&str>>(Destination::VT_NAME, None).unwrap()}
3400 }
3401 #[inline]
3402 pub fn type_(&self) -> &'a str {
3403 unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<&str>>(Destination::VT_TYPE_, None).unwrap()}
3407 }
3408}
3409
3410impl flatbuffers::Verifiable for Destination<'_> {
3411 #[inline]
3412 fn run_verifier(
3413 v: &mut flatbuffers::Verifier, pos: usize
3414 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
3415 use self::flatbuffers::Verifiable;
3416 v.visit_table(pos)?
3417 .visit_field::<u64>("id", Self::VT_ID, false)?
3418 .visit_field::<flatbuffers::ForwardsUOffset<&str>>("name", Self::VT_NAME, true)?
3419 .visit_field::<flatbuffers::ForwardsUOffset<&str>>("type_", Self::VT_TYPE_, true)?
3420 .finish();
3421 Ok(())
3422 }
3423}
3424pub struct DestinationArgs<'a> {
3425 pub id: u64,
3426 pub name: Option<flatbuffers::WIPOffset<&'a str>>,
3427 pub type_: Option<flatbuffers::WIPOffset<&'a str>>,
3428}
3429impl<'a> Default for DestinationArgs<'a> {
3430 #[inline]
3431 fn default() -> Self {
3432 DestinationArgs {
3433 id: 0,
3434 name: None, type_: None, }
3437 }
3438}
3439
3440pub struct DestinationBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
3441 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
3442 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
3443}
3444impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> DestinationBuilder<'a, 'b, A> {
3445 #[inline]
3446 pub fn add_id(&mut self, id: u64) {
3447 self.fbb_.push_slot::<u64>(Destination::VT_ID, id, 0);
3448 }
3449 #[inline]
3450 pub fn add_name(&mut self, name: flatbuffers::WIPOffset<&'b str>) {
3451 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Destination::VT_NAME, name);
3452 }
3453 #[inline]
3454 pub fn add_type_(&mut self, type_: flatbuffers::WIPOffset<&'b str>) {
3455 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Destination::VT_TYPE_, type_);
3456 }
3457 #[inline]
3458 pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> DestinationBuilder<'a, 'b, A> {
3459 let start = _fbb.start_table();
3460 DestinationBuilder {
3461 fbb_: _fbb,
3462 start_: start,
3463 }
3464 }
3465 #[inline]
3466 pub fn finish(self) -> flatbuffers::WIPOffset<Destination<'a>> {
3467 let o = self.fbb_.end_table(self.start_);
3468 self.fbb_.required(o, Destination::VT_NAME,"name");
3469 self.fbb_.required(o, Destination::VT_TYPE_,"type_");
3470 flatbuffers::WIPOffset::new(o.value())
3471 }
3472}
3473
3474impl core::fmt::Debug for Destination<'_> {
3475 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
3476 let mut ds = f.debug_struct("Destination");
3477 ds.field("id", &self.id());
3478 ds.field("name", &self.name());
3479 ds.field("type_", &self.type_());
3480 ds.finish()
3481 }
3482}
3483pub enum KeyValueU64SourceOffset {}
3484#[derive(Copy, Clone, PartialEq)]
3485
3486pub struct KeyValueU64Source<'a> {
3487 pub _tab: flatbuffers::Table<'a>,
3488}
3489
3490impl<'a> flatbuffers::Follow<'a> for KeyValueU64Source<'a> {
3491 type Inner = KeyValueU64Source<'a>;
3492 #[inline]
3493 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
3494 Self { _tab: flatbuffers::Table::new(buf, loc) }
3495 }
3496}
3497
3498impl<'a> KeyValueU64Source<'a> {
3499 pub const VT_KEY: flatbuffers::VOffsetT = 4;
3500 pub const VT_VALUE: flatbuffers::VOffsetT = 6;
3501
3502 #[inline]
3503 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
3504 KeyValueU64Source { _tab: table }
3505 }
3506 #[allow(unused_mut)]
3507 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
3508 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
3509 args: &'args KeyValueU64SourceArgs<'args>
3510 ) -> flatbuffers::WIPOffset<KeyValueU64Source<'bldr>> {
3511 let mut builder = KeyValueU64SourceBuilder::new(_fbb);
3512 builder.add_key(args.key);
3513 if let Some(x) = args.value { builder.add_value(x); }
3514 builder.finish()
3515 }
3516
3517
3518 #[inline]
3519 pub fn key(&self) -> u64 {
3520 unsafe { self._tab.get::<u64>(KeyValueU64Source::VT_KEY, Some(0)).unwrap()}
3524 }
3525 #[inline]
3526 pub fn value(&self) -> Source<'a> {
3527 unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<Source>>(KeyValueU64Source::VT_VALUE, None).unwrap()}
3531 }
3532}
3533
3534impl flatbuffers::Verifiable for KeyValueU64Source<'_> {
3535 #[inline]
3536 fn run_verifier(
3537 v: &mut flatbuffers::Verifier, pos: usize
3538 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
3539 use self::flatbuffers::Verifiable;
3540 v.visit_table(pos)?
3541 .visit_field::<u64>("key", Self::VT_KEY, false)?
3542 .visit_field::<flatbuffers::ForwardsUOffset<Source>>("value", Self::VT_VALUE, true)?
3543 .finish();
3544 Ok(())
3545 }
3546}
3547pub struct KeyValueU64SourceArgs<'a> {
3548 pub key: u64,
3549 pub value: Option<flatbuffers::WIPOffset<Source<'a>>>,
3550}
3551impl<'a> Default for KeyValueU64SourceArgs<'a> {
3552 #[inline]
3553 fn default() -> Self {
3554 KeyValueU64SourceArgs {
3555 key: 0,
3556 value: None, }
3558 }
3559}
3560
3561pub struct KeyValueU64SourceBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
3562 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
3563 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
3564}
3565impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> KeyValueU64SourceBuilder<'a, 'b, A> {
3566 #[inline]
3567 pub fn add_key(&mut self, key: u64) {
3568 self.fbb_.push_slot::<u64>(KeyValueU64Source::VT_KEY, key, 0);
3569 }
3570 #[inline]
3571 pub fn add_value(&mut self, value: flatbuffers::WIPOffset<Source<'b >>) {
3572 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<Source>>(KeyValueU64Source::VT_VALUE, value);
3573 }
3574 #[inline]
3575 pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> KeyValueU64SourceBuilder<'a, 'b, A> {
3576 let start = _fbb.start_table();
3577 KeyValueU64SourceBuilder {
3578 fbb_: _fbb,
3579 start_: start,
3580 }
3581 }
3582 #[inline]
3583 pub fn finish(self) -> flatbuffers::WIPOffset<KeyValueU64Source<'a>> {
3584 let o = self.fbb_.end_table(self.start_);
3585 self.fbb_.required(o, KeyValueU64Source::VT_VALUE,"value");
3586 flatbuffers::WIPOffset::new(o.value())
3587 }
3588}
3589
3590impl core::fmt::Debug for KeyValueU64Source<'_> {
3591 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
3592 let mut ds = f.debug_struct("KeyValueU64Source");
3593 ds.field("key", &self.key());
3594 ds.field("value", &self.value());
3595 ds.finish()
3596 }
3597}
3598pub enum KeyValueU64DestinationOffset {}
3599#[derive(Copy, Clone, PartialEq)]
3600
3601pub struct KeyValueU64Destination<'a> {
3602 pub _tab: flatbuffers::Table<'a>,
3603}
3604
3605impl<'a> flatbuffers::Follow<'a> for KeyValueU64Destination<'a> {
3606 type Inner = KeyValueU64Destination<'a>;
3607 #[inline]
3608 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
3609 Self { _tab: flatbuffers::Table::new(buf, loc) }
3610 }
3611}
3612
3613impl<'a> KeyValueU64Destination<'a> {
3614 pub const VT_KEY: flatbuffers::VOffsetT = 4;
3615 pub const VT_VALUE: flatbuffers::VOffsetT = 6;
3616
3617 #[inline]
3618 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
3619 KeyValueU64Destination { _tab: table }
3620 }
3621 #[allow(unused_mut)]
3622 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
3623 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
3624 args: &'args KeyValueU64DestinationArgs<'args>
3625 ) -> flatbuffers::WIPOffset<KeyValueU64Destination<'bldr>> {
3626 let mut builder = KeyValueU64DestinationBuilder::new(_fbb);
3627 builder.add_key(args.key);
3628 if let Some(x) = args.value { builder.add_value(x); }
3629 builder.finish()
3630 }
3631
3632
3633 #[inline]
3634 pub fn key(&self) -> u64 {
3635 unsafe { self._tab.get::<u64>(KeyValueU64Destination::VT_KEY, Some(0)).unwrap()}
3639 }
3640 #[inline]
3641 pub fn value(&self) -> Destination<'a> {
3642 unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<Destination>>(KeyValueU64Destination::VT_VALUE, None).unwrap()}
3646 }
3647}
3648
3649impl flatbuffers::Verifiable for KeyValueU64Destination<'_> {
3650 #[inline]
3651 fn run_verifier(
3652 v: &mut flatbuffers::Verifier, pos: usize
3653 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
3654 use self::flatbuffers::Verifiable;
3655 v.visit_table(pos)?
3656 .visit_field::<u64>("key", Self::VT_KEY, false)?
3657 .visit_field::<flatbuffers::ForwardsUOffset<Destination>>("value", Self::VT_VALUE, true)?
3658 .finish();
3659 Ok(())
3660 }
3661}
3662pub struct KeyValueU64DestinationArgs<'a> {
3663 pub key: u64,
3664 pub value: Option<flatbuffers::WIPOffset<Destination<'a>>>,
3665}
3666impl<'a> Default for KeyValueU64DestinationArgs<'a> {
3667 #[inline]
3668 fn default() -> Self {
3669 KeyValueU64DestinationArgs {
3670 key: 0,
3671 value: None, }
3673 }
3674}
3675
3676pub struct KeyValueU64DestinationBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
3677 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
3678 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
3679}
3680impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> KeyValueU64DestinationBuilder<'a, 'b, A> {
3681 #[inline]
3682 pub fn add_key(&mut self, key: u64) {
3683 self.fbb_.push_slot::<u64>(KeyValueU64Destination::VT_KEY, key, 0);
3684 }
3685 #[inline]
3686 pub fn add_value(&mut self, value: flatbuffers::WIPOffset<Destination<'b >>) {
3687 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<Destination>>(KeyValueU64Destination::VT_VALUE, value);
3688 }
3689 #[inline]
3690 pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> KeyValueU64DestinationBuilder<'a, 'b, A> {
3691 let start = _fbb.start_table();
3692 KeyValueU64DestinationBuilder {
3693 fbb_: _fbb,
3694 start_: start,
3695 }
3696 }
3697 #[inline]
3698 pub fn finish(self) -> flatbuffers::WIPOffset<KeyValueU64Destination<'a>> {
3699 let o = self.fbb_.end_table(self.start_);
3700 self.fbb_.required(o, KeyValueU64Destination::VT_VALUE,"value");
3701 flatbuffers::WIPOffset::new(o.value())
3702 }
3703}
3704
3705impl core::fmt::Debug for KeyValueU64Destination<'_> {
3706 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
3707 let mut ds = f.debug_struct("KeyValueU64Destination");
3708 ds.field("key", &self.key());
3709 ds.field("value", &self.value());
3710 ds.finish()
3711 }
3712}
3713pub enum PlanOffset {}
3714#[derive(Copy, Clone, PartialEq)]
3715
3716pub struct Plan<'a> {
3717 pub _tab: flatbuffers::Table<'a>,
3718}
3719
3720impl<'a> flatbuffers::Follow<'a> for Plan<'a> {
3721 type Inner = Plan<'a>;
3722 #[inline]
3723 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
3724 Self { _tab: flatbuffers::Table::new(buf, loc) }
3725 }
3726}
3727
3728impl<'a> Plan<'a> {
3729 pub const VT_ID: flatbuffers::VOffsetT = 4;
3730 pub const VT_NAME: flatbuffers::VOffsetT = 6;
3731 pub const VT_TEMPLATE: flatbuffers::VOffsetT = 8;
3732 pub const VT_LINES: flatbuffers::VOffsetT = 10;
3733 pub const VT_STATIONS: flatbuffers::VOffsetT = 12;
3734 pub const VT_STATIONS_TO_IN_OUTS: flatbuffers::VOffsetT = 14;
3735 pub const VT_SOURCES: flatbuffers::VOffsetT = 16;
3736 pub const VT_DESTINATIONS: flatbuffers::VOffsetT = 18;
3737 pub const VT_STATUS: flatbuffers::VOffsetT = 20;
3738 pub const VT_TRANSFORMS: flatbuffers::VOffsetT = 22;
3739
3740 #[inline]
3741 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
3742 Plan { _tab: table }
3743 }
3744 #[allow(unused_mut)]
3745 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
3746 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
3747 args: &'args PlanArgs<'args>
3748 ) -> flatbuffers::WIPOffset<Plan<'bldr>> {
3749 let mut builder = PlanBuilder::new(_fbb);
3750 builder.add_id(args.id);
3751 if let Some(x) = args.transforms { builder.add_transforms(x); }
3752 if let Some(x) = args.destinations { builder.add_destinations(x); }
3753 if let Some(x) = args.sources { builder.add_sources(x); }
3754 if let Some(x) = args.stations_to_in_outs { builder.add_stations_to_in_outs(x); }
3755 if let Some(x) = args.stations { builder.add_stations(x); }
3756 if let Some(x) = args.lines { builder.add_lines(x); }
3757 if let Some(x) = args.template { builder.add_template(x); }
3758 if let Some(x) = args.name { builder.add_name(x); }
3759 builder.add_status(args.status);
3760 builder.finish()
3761 }
3762
3763
3764 #[inline]
3765 pub fn id(&self) -> u64 {
3766 unsafe { self._tab.get::<u64>(Plan::VT_ID, Some(0)).unwrap()}
3770 }
3771 #[inline]
3772 pub fn name(&self) -> Option<&'a str> {
3773 unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<&str>>(Plan::VT_NAME, None)}
3777 }
3778 #[inline]
3779 pub fn template(&self) -> Option<&'a str> {
3780 unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<&str>>(Plan::VT_TEMPLATE, None)}
3784 }
3785 #[inline]
3786 pub fn lines(&self) -> Option<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<KeyValueU64VecU64<'a>>>> {
3787 unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<KeyValueU64VecU64>>>>(Plan::VT_LINES, None)}
3791 }
3792 #[inline]
3793 pub fn stations(&self) -> Option<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<KeyValueU64Station<'a>>>> {
3794 unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<KeyValueU64Station>>>>(Plan::VT_STATIONS, None)}
3798 }
3799 #[inline]
3800 pub fn stations_to_in_outs(&self) -> Option<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<KeyValueU64VecU64<'a>>>> {
3801 unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<KeyValueU64VecU64>>>>(Plan::VT_STATIONS_TO_IN_OUTS, None)}
3805 }
3806 #[inline]
3807 pub fn sources(&self) -> Option<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<KeyValueU64Source<'a>>>> {
3808 unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<KeyValueU64Source>>>>(Plan::VT_SOURCES, None)}
3812 }
3813 #[inline]
3814 pub fn destinations(&self) -> Option<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<KeyValueU64Destination<'a>>>> {
3815 unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<KeyValueU64Destination>>>>(Plan::VT_DESTINATIONS, None)}
3819 }
3820 #[inline]
3821 pub fn status(&self) -> PlanStatus {
3822 unsafe { self._tab.get::<PlanStatus>(Plan::VT_STATUS, Some(PlanStatus::Running)).unwrap()}
3826 }
3827 #[inline]
3828 pub fn transforms(&self) -> Option<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<KeyValueStringTransform<'a>>>> {
3829 unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<KeyValueStringTransform>>>>(Plan::VT_TRANSFORMS, None)}
3833 }
3834}
3835
3836impl flatbuffers::Verifiable for Plan<'_> {
3837 #[inline]
3838 fn run_verifier(
3839 v: &mut flatbuffers::Verifier, pos: usize
3840 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
3841 use self::flatbuffers::Verifiable;
3842 v.visit_table(pos)?
3843 .visit_field::<u64>("id", Self::VT_ID, false)?
3844 .visit_field::<flatbuffers::ForwardsUOffset<&str>>("name", Self::VT_NAME, false)?
3845 .visit_field::<flatbuffers::ForwardsUOffset<&str>>("template", Self::VT_TEMPLATE, false)?
3846 .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, flatbuffers::ForwardsUOffset<KeyValueU64VecU64>>>>("lines", Self::VT_LINES, false)?
3847 .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, flatbuffers::ForwardsUOffset<KeyValueU64Station>>>>("stations", Self::VT_STATIONS, false)?
3848 .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, flatbuffers::ForwardsUOffset<KeyValueU64VecU64>>>>("stations_to_in_outs", Self::VT_STATIONS_TO_IN_OUTS, false)?
3849 .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, flatbuffers::ForwardsUOffset<KeyValueU64Source>>>>("sources", Self::VT_SOURCES, false)?
3850 .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, flatbuffers::ForwardsUOffset<KeyValueU64Destination>>>>("destinations", Self::VT_DESTINATIONS, false)?
3851 .visit_field::<PlanStatus>("status", Self::VT_STATUS, false)?
3852 .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, flatbuffers::ForwardsUOffset<KeyValueStringTransform>>>>("transforms", Self::VT_TRANSFORMS, false)?
3853 .finish();
3854 Ok(())
3855 }
3856}
3857pub struct PlanArgs<'a> {
3858 pub id: u64,
3859 pub name: Option<flatbuffers::WIPOffset<&'a str>>,
3860 pub template: Option<flatbuffers::WIPOffset<&'a str>>,
3861 pub lines: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<KeyValueU64VecU64<'a>>>>>,
3862 pub stations: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<KeyValueU64Station<'a>>>>>,
3863 pub stations_to_in_outs: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<KeyValueU64VecU64<'a>>>>>,
3864 pub sources: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<KeyValueU64Source<'a>>>>>,
3865 pub destinations: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<KeyValueU64Destination<'a>>>>>,
3866 pub status: PlanStatus,
3867 pub transforms: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<KeyValueStringTransform<'a>>>>>,
3868}
3869impl<'a> Default for PlanArgs<'a> {
3870 #[inline]
3871 fn default() -> Self {
3872 PlanArgs {
3873 id: 0,
3874 name: None,
3875 template: None,
3876 lines: None,
3877 stations: None,
3878 stations_to_in_outs: None,
3879 sources: None,
3880 destinations: None,
3881 status: PlanStatus::Running,
3882 transforms: None,
3883 }
3884 }
3885}
3886
3887pub struct PlanBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
3888 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
3889 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
3890}
3891impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> PlanBuilder<'a, 'b, A> {
3892 #[inline]
3893 pub fn add_id(&mut self, id: u64) {
3894 self.fbb_.push_slot::<u64>(Plan::VT_ID, id, 0);
3895 }
3896 #[inline]
3897 pub fn add_name(&mut self, name: flatbuffers::WIPOffset<&'b str>) {
3898 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Plan::VT_NAME, name);
3899 }
3900 #[inline]
3901 pub fn add_template(&mut self, template: flatbuffers::WIPOffset<&'b str>) {
3902 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Plan::VT_TEMPLATE, template);
3903 }
3904 #[inline]
3905 pub fn add_lines(&mut self, lines: flatbuffers::WIPOffset<flatbuffers::Vector<'b , flatbuffers::ForwardsUOffset<KeyValueU64VecU64<'b >>>>) {
3906 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Plan::VT_LINES, lines);
3907 }
3908 #[inline]
3909 pub fn add_stations(&mut self, stations: flatbuffers::WIPOffset<flatbuffers::Vector<'b , flatbuffers::ForwardsUOffset<KeyValueU64Station<'b >>>>) {
3910 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Plan::VT_STATIONS, stations);
3911 }
3912 #[inline]
3913 pub fn add_stations_to_in_outs(&mut self, stations_to_in_outs: flatbuffers::WIPOffset<flatbuffers::Vector<'b , flatbuffers::ForwardsUOffset<KeyValueU64VecU64<'b >>>>) {
3914 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Plan::VT_STATIONS_TO_IN_OUTS, stations_to_in_outs);
3915 }
3916 #[inline]
3917 pub fn add_sources(&mut self, sources: flatbuffers::WIPOffset<flatbuffers::Vector<'b , flatbuffers::ForwardsUOffset<KeyValueU64Source<'b >>>>) {
3918 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Plan::VT_SOURCES, sources);
3919 }
3920 #[inline]
3921 pub fn add_destinations(&mut self, destinations: flatbuffers::WIPOffset<flatbuffers::Vector<'b , flatbuffers::ForwardsUOffset<KeyValueU64Destination<'b >>>>) {
3922 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Plan::VT_DESTINATIONS, destinations);
3923 }
3924 #[inline]
3925 pub fn add_status(&mut self, status: PlanStatus) {
3926 self.fbb_.push_slot::<PlanStatus>(Plan::VT_STATUS, status, PlanStatus::Running);
3927 }
3928 #[inline]
3929 pub fn add_transforms(&mut self, transforms: flatbuffers::WIPOffset<flatbuffers::Vector<'b , flatbuffers::ForwardsUOffset<KeyValueStringTransform<'b >>>>) {
3930 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Plan::VT_TRANSFORMS, transforms);
3931 }
3932 #[inline]
3933 pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> PlanBuilder<'a, 'b, A> {
3934 let start = _fbb.start_table();
3935 PlanBuilder {
3936 fbb_: _fbb,
3937 start_: start,
3938 }
3939 }
3940 #[inline]
3941 pub fn finish(self) -> flatbuffers::WIPOffset<Plan<'a>> {
3942 let o = self.fbb_.end_table(self.start_);
3943 flatbuffers::WIPOffset::new(o.value())
3944 }
3945}
3946
3947impl core::fmt::Debug for Plan<'_> {
3948 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
3949 let mut ds = f.debug_struct("Plan");
3950 ds.field("id", &self.id());
3951 ds.field("name", &self.name());
3952 ds.field("template", &self.template());
3953 ds.field("lines", &self.lines());
3954 ds.field("stations", &self.stations());
3955 ds.field("stations_to_in_outs", &self.stations_to_in_outs());
3956 ds.field("sources", &self.sources());
3957 ds.field("destinations", &self.destinations());
3958 ds.field("status", &self.status());
3959 ds.field("transforms", &self.transforms());
3960 ds.finish()
3961 }
3962}
3963pub enum PlansOffset {}
3964#[derive(Copy, Clone, PartialEq)]
3965
3966pub struct Plans<'a> {
3967 pub _tab: flatbuffers::Table<'a>,
3968}
3969
3970impl<'a> flatbuffers::Follow<'a> for Plans<'a> {
3971 type Inner = Plans<'a>;
3972 #[inline]
3973 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
3974 Self { _tab: flatbuffers::Table::new(buf, loc) }
3975 }
3976}
3977
3978impl<'a> Plans<'a> {
3979 pub const VT_PLANS: flatbuffers::VOffsetT = 4;
3980
3981 #[inline]
3982 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
3983 Plans { _tab: table }
3984 }
3985 #[allow(unused_mut)]
3986 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
3987 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
3988 args: &'args PlansArgs<'args>
3989 ) -> flatbuffers::WIPOffset<Plans<'bldr>> {
3990 let mut builder = PlansBuilder::new(_fbb);
3991 if let Some(x) = args.plans { builder.add_plans(x); }
3992 builder.finish()
3993 }
3994
3995
3996 #[inline]
3997 pub fn plans(&self) -> flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<Plan<'a>>> {
3998 unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<Plan>>>>(Plans::VT_PLANS, None).unwrap()}
4002 }
4003}
4004
4005impl flatbuffers::Verifiable for Plans<'_> {
4006 #[inline]
4007 fn run_verifier(
4008 v: &mut flatbuffers::Verifier, pos: usize
4009 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
4010 use self::flatbuffers::Verifiable;
4011 v.visit_table(pos)?
4012 .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, flatbuffers::ForwardsUOffset<Plan>>>>("plans", Self::VT_PLANS, true)?
4013 .finish();
4014 Ok(())
4015 }
4016}
4017pub struct PlansArgs<'a> {
4018 pub plans: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<Plan<'a>>>>>,
4019}
4020impl<'a> Default for PlansArgs<'a> {
4021 #[inline]
4022 fn default() -> Self {
4023 PlansArgs {
4024 plans: None, }
4026 }
4027}
4028
4029pub struct PlansBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
4030 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
4031 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
4032}
4033impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> PlansBuilder<'a, 'b, A> {
4034 #[inline]
4035 pub fn add_plans(&mut self, plans: flatbuffers::WIPOffset<flatbuffers::Vector<'b , flatbuffers::ForwardsUOffset<Plan<'b >>>>) {
4036 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Plans::VT_PLANS, plans);
4037 }
4038 #[inline]
4039 pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> PlansBuilder<'a, 'b, A> {
4040 let start = _fbb.start_table();
4041 PlansBuilder {
4042 fbb_: _fbb,
4043 start_: start,
4044 }
4045 }
4046 #[inline]
4047 pub fn finish(self) -> flatbuffers::WIPOffset<Plans<'a>> {
4048 let o = self.fbb_.end_table(self.start_);
4049 self.fbb_.required(o, Plans::VT_PLANS,"plans");
4050 flatbuffers::WIPOffset::new(o.value())
4051 }
4052}
4053
4054impl core::fmt::Debug for Plans<'_> {
4055 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
4056 let mut ds = f.debug_struct("Plans");
4057 ds.field("plans", &self.plans());
4058 ds.finish()
4059 }
4060}
4061pub enum DisconnectOffset {}
4062#[derive(Copy, Clone, PartialEq)]
4063
4064pub struct Disconnect<'a> {
4065 pub _tab: flatbuffers::Table<'a>,
4066}
4067
4068impl<'a> flatbuffers::Follow<'a> for Disconnect<'a> {
4069 type Inner = Disconnect<'a>;
4070 #[inline]
4071 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
4072 Self { _tab: flatbuffers::Table::new(buf, loc) }
4073 }
4074}
4075
4076impl<'a> Disconnect<'a> {
4077 pub const VT_ID: flatbuffers::VOffsetT = 4;
4078
4079 #[inline]
4080 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
4081 Disconnect { _tab: table }
4082 }
4083 #[allow(unused_mut)]
4084 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
4085 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
4086 args: &'args DisconnectArgs
4087 ) -> flatbuffers::WIPOffset<Disconnect<'bldr>> {
4088 let mut builder = DisconnectBuilder::new(_fbb);
4089 builder.add_id(args.id);
4090 builder.finish()
4091 }
4092
4093
4094 #[inline]
4095 pub fn id(&self) -> u64 {
4096 unsafe { self._tab.get::<u64>(Disconnect::VT_ID, Some(0)).unwrap()}
4100 }
4101}
4102
4103impl flatbuffers::Verifiable for Disconnect<'_> {
4104 #[inline]
4105 fn run_verifier(
4106 v: &mut flatbuffers::Verifier, pos: usize
4107 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
4108 use self::flatbuffers::Verifiable;
4109 v.visit_table(pos)?
4110 .visit_field::<u64>("id", Self::VT_ID, false)?
4111 .finish();
4112 Ok(())
4113 }
4114}
4115pub struct DisconnectArgs {
4116 pub id: u64,
4117}
4118impl<'a> Default for DisconnectArgs {
4119 #[inline]
4120 fn default() -> Self {
4121 DisconnectArgs {
4122 id: 0,
4123 }
4124 }
4125}
4126
4127pub struct DisconnectBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
4128 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
4129 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
4130}
4131impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> DisconnectBuilder<'a, 'b, A> {
4132 #[inline]
4133 pub fn add_id(&mut self, id: u64) {
4134 self.fbb_.push_slot::<u64>(Disconnect::VT_ID, id, 0);
4135 }
4136 #[inline]
4137 pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> DisconnectBuilder<'a, 'b, A> {
4138 let start = _fbb.start_table();
4139 DisconnectBuilder {
4140 fbb_: _fbb,
4141 start_: start,
4142 }
4143 }
4144 #[inline]
4145 pub fn finish(self) -> flatbuffers::WIPOffset<Disconnect<'a>> {
4146 let o = self.fbb_.end_table(self.start_);
4147 flatbuffers::WIPOffset::new(o.value())
4148 }
4149}
4150
4151impl core::fmt::Debug for Disconnect<'_> {
4152 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
4153 let mut ds = f.debug_struct("Disconnect");
4154 ds.field("id", &self.id());
4155 ds.finish()
4156 }
4157}
4158pub enum RegisterResponseOffset {}
4159#[derive(Copy, Clone, PartialEq)]
4160
4161pub struct RegisterResponse<'a> {
4162 pub _tab: flatbuffers::Table<'a>,
4163}
4164
4165impl<'a> flatbuffers::Follow<'a> for RegisterResponse<'a> {
4166 type Inner = RegisterResponse<'a>;
4167 #[inline]
4168 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
4169 Self { _tab: flatbuffers::Table::new(buf, loc) }
4170 }
4171}
4172
4173impl<'a> RegisterResponse<'a> {
4174 pub const VT_ID: flatbuffers::VOffsetT = 4;
4175 pub const VT_PERMISSIONS: flatbuffers::VOffsetT = 6;
4176 pub const VT_CATALOG: flatbuffers::VOffsetT = 8;
4177
4178 #[inline]
4179 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
4180 RegisterResponse { _tab: table }
4181 }
4182 #[allow(unused_mut)]
4183 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
4184 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
4185 args: &'args RegisterResponseArgs<'args>
4186 ) -> flatbuffers::WIPOffset<RegisterResponse<'bldr>> {
4187 let mut builder = RegisterResponseBuilder::new(_fbb);
4188 if let Some(x) = args.id { builder.add_id(x); }
4189 if let Some(x) = args.catalog { builder.add_catalog(x); }
4190 if let Some(x) = args.permissions { builder.add_permissions(x); }
4191 builder.finish()
4192 }
4193
4194
4195 #[inline]
4196 pub fn id(&self) -> Option<u64> {
4197 unsafe { self._tab.get::<u64>(RegisterResponse::VT_ID, None)}
4201 }
4202 #[inline]
4203 pub fn permissions(&self) -> Option<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<&'a str>>> {
4204 unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<&'a str>>>>(RegisterResponse::VT_PERMISSIONS, None)}
4208 }
4209 #[inline]
4210 pub fn catalog(&self) -> Option<Catalog<'a>> {
4211 unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<Catalog>>(RegisterResponse::VT_CATALOG, None)}
4215 }
4216}
4217
4218impl flatbuffers::Verifiable for RegisterResponse<'_> {
4219 #[inline]
4220 fn run_verifier(
4221 v: &mut flatbuffers::Verifier, pos: usize
4222 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
4223 use self::flatbuffers::Verifiable;
4224 v.visit_table(pos)?
4225 .visit_field::<u64>("id", Self::VT_ID, false)?
4226 .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, flatbuffers::ForwardsUOffset<&'_ str>>>>("permissions", Self::VT_PERMISSIONS, false)?
4227 .visit_field::<flatbuffers::ForwardsUOffset<Catalog>>("catalog", Self::VT_CATALOG, false)?
4228 .finish();
4229 Ok(())
4230 }
4231}
4232pub struct RegisterResponseArgs<'a> {
4233 pub id: Option<u64>,
4234 pub permissions: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<&'a str>>>>,
4235 pub catalog: Option<flatbuffers::WIPOffset<Catalog<'a>>>,
4236}
4237impl<'a> Default for RegisterResponseArgs<'a> {
4238 #[inline]
4239 fn default() -> Self {
4240 RegisterResponseArgs {
4241 id: None,
4242 permissions: None,
4243 catalog: None,
4244 }
4245 }
4246}
4247
4248pub struct RegisterResponseBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
4249 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
4250 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
4251}
4252impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> RegisterResponseBuilder<'a, 'b, A> {
4253 #[inline]
4254 pub fn add_id(&mut self, id: u64) {
4255 self.fbb_.push_slot_always::<u64>(RegisterResponse::VT_ID, id);
4256 }
4257 #[inline]
4258 pub fn add_permissions(&mut self, permissions: flatbuffers::WIPOffset<flatbuffers::Vector<'b , flatbuffers::ForwardsUOffset<&'b str>>>) {
4259 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(RegisterResponse::VT_PERMISSIONS, permissions);
4260 }
4261 #[inline]
4262 pub fn add_catalog(&mut self, catalog: flatbuffers::WIPOffset<Catalog<'b >>) {
4263 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<Catalog>>(RegisterResponse::VT_CATALOG, catalog);
4264 }
4265 #[inline]
4266 pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> RegisterResponseBuilder<'a, 'b, A> {
4267 let start = _fbb.start_table();
4268 RegisterResponseBuilder {
4269 fbb_: _fbb,
4270 start_: start,
4271 }
4272 }
4273 #[inline]
4274 pub fn finish(self) -> flatbuffers::WIPOffset<RegisterResponse<'a>> {
4275 let o = self.fbb_.end_table(self.start_);
4276 flatbuffers::WIPOffset::new(o.value())
4277 }
4278}
4279
4280impl core::fmt::Debug for RegisterResponse<'_> {
4281 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
4282 let mut ds = f.debug_struct("RegisterResponse");
4283 ds.field("id", &self.id());
4284 ds.field("permissions", &self.permissions());
4285 ds.field("catalog", &self.catalog());
4286 ds.finish()
4287 }
4288}
4289pub enum RegisterRequestOffset {}
4290#[derive(Copy, Clone, PartialEq)]
4291
4292pub struct RegisterRequest<'a> {
4293 pub _tab: flatbuffers::Table<'a>,
4294}
4295
4296impl<'a> flatbuffers::Follow<'a> for RegisterRequest<'a> {
4297 type Inner = RegisterRequest<'a>;
4298 #[inline]
4299 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
4300 Self { _tab: flatbuffers::Table::new(buf, loc) }
4301 }
4302}
4303
4304impl<'a> RegisterRequest<'a> {
4305 pub const VT_ID: flatbuffers::VOffsetT = 4;
4306 pub const VT_CATALOG: flatbuffers::VOffsetT = 6;
4307
4308 #[inline]
4309 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
4310 RegisterRequest { _tab: table }
4311 }
4312 #[allow(unused_mut)]
4313 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
4314 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
4315 args: &'args RegisterRequestArgs<'args>
4316 ) -> flatbuffers::WIPOffset<RegisterRequest<'bldr>> {
4317 let mut builder = RegisterRequestBuilder::new(_fbb);
4318 if let Some(x) = args.id { builder.add_id(x); }
4319 if let Some(x) = args.catalog { builder.add_catalog(x); }
4320 builder.finish()
4321 }
4322
4323
4324 #[inline]
4325 pub fn id(&self) -> Option<u64> {
4326 unsafe { self._tab.get::<u64>(RegisterRequest::VT_ID, None)}
4330 }
4331 #[inline]
4332 pub fn catalog(&self) -> Option<Catalog<'a>> {
4333 unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<Catalog>>(RegisterRequest::VT_CATALOG, None)}
4337 }
4338}
4339
4340impl flatbuffers::Verifiable for RegisterRequest<'_> {
4341 #[inline]
4342 fn run_verifier(
4343 v: &mut flatbuffers::Verifier, pos: usize
4344 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
4345 use self::flatbuffers::Verifiable;
4346 v.visit_table(pos)?
4347 .visit_field::<u64>("id", Self::VT_ID, false)?
4348 .visit_field::<flatbuffers::ForwardsUOffset<Catalog>>("catalog", Self::VT_CATALOG, false)?
4349 .finish();
4350 Ok(())
4351 }
4352}
4353pub struct RegisterRequestArgs<'a> {
4354 pub id: Option<u64>,
4355 pub catalog: Option<flatbuffers::WIPOffset<Catalog<'a>>>,
4356}
4357impl<'a> Default for RegisterRequestArgs<'a> {
4358 #[inline]
4359 fn default() -> Self {
4360 RegisterRequestArgs {
4361 id: None,
4362 catalog: None,
4363 }
4364 }
4365}
4366
4367pub struct RegisterRequestBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
4368 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
4369 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
4370}
4371impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> RegisterRequestBuilder<'a, 'b, A> {
4372 #[inline]
4373 pub fn add_id(&mut self, id: u64) {
4374 self.fbb_.push_slot_always::<u64>(RegisterRequest::VT_ID, id);
4375 }
4376 #[inline]
4377 pub fn add_catalog(&mut self, catalog: flatbuffers::WIPOffset<Catalog<'b >>) {
4378 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<Catalog>>(RegisterRequest::VT_CATALOG, catalog);
4379 }
4380 #[inline]
4381 pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> RegisterRequestBuilder<'a, 'b, A> {
4382 let start = _fbb.start_table();
4383 RegisterRequestBuilder {
4384 fbb_: _fbb,
4385 start_: start,
4386 }
4387 }
4388 #[inline]
4389 pub fn finish(self) -> flatbuffers::WIPOffset<RegisterRequest<'a>> {
4390 let o = self.fbb_.end_table(self.start_);
4391 flatbuffers::WIPOffset::new(o.value())
4392 }
4393}
4394
4395impl core::fmt::Debug for RegisterRequest<'_> {
4396 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
4397 let mut ds = f.debug_struct("RegisterRequest");
4398 ds.field("id", &self.id());
4399 ds.field("catalog", &self.catalog());
4400 ds.finish()
4401 }
4402}
4403pub enum CreatePlanRequestOffset {}
4404#[derive(Copy, Clone, PartialEq)]
4405
4406pub struct CreatePlanRequest<'a> {
4407 pub _tab: flatbuffers::Table<'a>,
4408}
4409
4410impl<'a> flatbuffers::Follow<'a> for CreatePlanRequest<'a> {
4411 type Inner = CreatePlanRequest<'a>;
4412 #[inline]
4413 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
4414 Self { _tab: flatbuffers::Table::new(buf, loc) }
4415 }
4416}
4417
4418impl<'a> CreatePlanRequest<'a> {
4419 pub const VT_NAME: flatbuffers::VOffsetT = 4;
4420 pub const VT_PLAN: flatbuffers::VOffsetT = 6;
4421
4422 #[inline]
4423 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
4424 CreatePlanRequest { _tab: table }
4425 }
4426 #[allow(unused_mut)]
4427 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
4428 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
4429 args: &'args CreatePlanRequestArgs<'args>
4430 ) -> flatbuffers::WIPOffset<CreatePlanRequest<'bldr>> {
4431 let mut builder = CreatePlanRequestBuilder::new(_fbb);
4432 if let Some(x) = args.plan { builder.add_plan(x); }
4433 if let Some(x) = args.name { builder.add_name(x); }
4434 builder.finish()
4435 }
4436
4437
4438 #[inline]
4439 pub fn name(&self) -> Option<&'a str> {
4440 unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<&str>>(CreatePlanRequest::VT_NAME, None)}
4444 }
4445 #[inline]
4446 pub fn plan(&self) -> Option<&'a str> {
4447 unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<&str>>(CreatePlanRequest::VT_PLAN, None)}
4451 }
4452}
4453
4454impl flatbuffers::Verifiable for CreatePlanRequest<'_> {
4455 #[inline]
4456 fn run_verifier(
4457 v: &mut flatbuffers::Verifier, pos: usize
4458 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
4459 use self::flatbuffers::Verifiable;
4460 v.visit_table(pos)?
4461 .visit_field::<flatbuffers::ForwardsUOffset<&str>>("name", Self::VT_NAME, false)?
4462 .visit_field::<flatbuffers::ForwardsUOffset<&str>>("plan", Self::VT_PLAN, false)?
4463 .finish();
4464 Ok(())
4465 }
4466}
4467pub struct CreatePlanRequestArgs<'a> {
4468 pub name: Option<flatbuffers::WIPOffset<&'a str>>,
4469 pub plan: Option<flatbuffers::WIPOffset<&'a str>>,
4470}
4471impl<'a> Default for CreatePlanRequestArgs<'a> {
4472 #[inline]
4473 fn default() -> Self {
4474 CreatePlanRequestArgs {
4475 name: None,
4476 plan: None,
4477 }
4478 }
4479}
4480
4481pub struct CreatePlanRequestBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
4482 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
4483 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
4484}
4485impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> CreatePlanRequestBuilder<'a, 'b, A> {
4486 #[inline]
4487 pub fn add_name(&mut self, name: flatbuffers::WIPOffset<&'b str>) {
4488 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(CreatePlanRequest::VT_NAME, name);
4489 }
4490 #[inline]
4491 pub fn add_plan(&mut self, plan: flatbuffers::WIPOffset<&'b str>) {
4492 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(CreatePlanRequest::VT_PLAN, plan);
4493 }
4494 #[inline]
4495 pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> CreatePlanRequestBuilder<'a, 'b, A> {
4496 let start = _fbb.start_table();
4497 CreatePlanRequestBuilder {
4498 fbb_: _fbb,
4499 start_: start,
4500 }
4501 }
4502 #[inline]
4503 pub fn finish(self) -> flatbuffers::WIPOffset<CreatePlanRequest<'a>> {
4504 let o = self.fbb_.end_table(self.start_);
4505 flatbuffers::WIPOffset::new(o.value())
4506 }
4507}
4508
4509impl core::fmt::Debug for CreatePlanRequest<'_> {
4510 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
4511 let mut ds = f.debug_struct("CreatePlanRequest");
4512 ds.field("name", &self.name());
4513 ds.field("plan", &self.plan());
4514 ds.finish()
4515 }
4516}
4517pub enum CreatePlanResponseOffset {}
4518#[derive(Copy, Clone, PartialEq)]
4519
4520pub struct CreatePlanResponse<'a> {
4521 pub _tab: flatbuffers::Table<'a>,
4522}
4523
4524impl<'a> flatbuffers::Follow<'a> for CreatePlanResponse<'a> {
4525 type Inner = CreatePlanResponse<'a>;
4526 #[inline]
4527 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
4528 Self { _tab: flatbuffers::Table::new(buf, loc) }
4529 }
4530}
4531
4532impl<'a> CreatePlanResponse<'a> {
4533 pub const VT_ID: flatbuffers::VOffsetT = 4;
4534
4535 #[inline]
4536 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
4537 CreatePlanResponse { _tab: table }
4538 }
4539 #[allow(unused_mut)]
4540 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
4541 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
4542 args: &'args CreatePlanResponseArgs
4543 ) -> flatbuffers::WIPOffset<CreatePlanResponse<'bldr>> {
4544 let mut builder = CreatePlanResponseBuilder::new(_fbb);
4545 builder.add_id(args.id);
4546 builder.finish()
4547 }
4548
4549
4550 #[inline]
4551 pub fn id(&self) -> u64 {
4552 unsafe { self._tab.get::<u64>(CreatePlanResponse::VT_ID, Some(0)).unwrap()}
4556 }
4557}
4558
4559impl flatbuffers::Verifiable for CreatePlanResponse<'_> {
4560 #[inline]
4561 fn run_verifier(
4562 v: &mut flatbuffers::Verifier, pos: usize
4563 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
4564 use self::flatbuffers::Verifiable;
4565 v.visit_table(pos)?
4566 .visit_field::<u64>("id", Self::VT_ID, false)?
4567 .finish();
4568 Ok(())
4569 }
4570}
4571pub struct CreatePlanResponseArgs {
4572 pub id: u64,
4573}
4574impl<'a> Default for CreatePlanResponseArgs {
4575 #[inline]
4576 fn default() -> Self {
4577 CreatePlanResponseArgs {
4578 id: 0,
4579 }
4580 }
4581}
4582
4583pub struct CreatePlanResponseBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
4584 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
4585 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
4586}
4587impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> CreatePlanResponseBuilder<'a, 'b, A> {
4588 #[inline]
4589 pub fn add_id(&mut self, id: u64) {
4590 self.fbb_.push_slot::<u64>(CreatePlanResponse::VT_ID, id, 0);
4591 }
4592 #[inline]
4593 pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> CreatePlanResponseBuilder<'a, 'b, A> {
4594 let start = _fbb.start_table();
4595 CreatePlanResponseBuilder {
4596 fbb_: _fbb,
4597 start_: start,
4598 }
4599 }
4600 #[inline]
4601 pub fn finish(self) -> flatbuffers::WIPOffset<CreatePlanResponse<'a>> {
4602 let o = self.fbb_.end_table(self.start_);
4603 flatbuffers::WIPOffset::new(o.value())
4604 }
4605}
4606
4607impl core::fmt::Debug for CreatePlanResponse<'_> {
4608 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
4609 let mut ds = f.debug_struct("CreatePlanResponse");
4610 ds.field("id", &self.id());
4611 ds.finish()
4612 }
4613}
4614pub enum ByNameOffset {}
4615#[derive(Copy, Clone, PartialEq)]
4616
4617pub struct ByName<'a> {
4618 pub _tab: flatbuffers::Table<'a>,
4619}
4620
4621impl<'a> flatbuffers::Follow<'a> for ByName<'a> {
4622 type Inner = ByName<'a>;
4623 #[inline]
4624 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
4625 Self { _tab: flatbuffers::Table::new(buf, loc) }
4626 }
4627}
4628
4629impl<'a> ByName<'a> {
4630 pub const VT_NAME: flatbuffers::VOffsetT = 4;
4631
4632 #[inline]
4633 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
4634 ByName { _tab: table }
4635 }
4636 #[allow(unused_mut)]
4637 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
4638 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
4639 args: &'args ByNameArgs<'args>
4640 ) -> flatbuffers::WIPOffset<ByName<'bldr>> {
4641 let mut builder = ByNameBuilder::new(_fbb);
4642 if let Some(x) = args.name { builder.add_name(x); }
4643 builder.finish()
4644 }
4645
4646
4647 #[inline]
4648 pub fn name(&self) -> Option<&'a str> {
4649 unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<&str>>(ByName::VT_NAME, None)}
4653 }
4654}
4655
4656impl flatbuffers::Verifiable for ByName<'_> {
4657 #[inline]
4658 fn run_verifier(
4659 v: &mut flatbuffers::Verifier, pos: usize
4660 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
4661 use self::flatbuffers::Verifiable;
4662 v.visit_table(pos)?
4663 .visit_field::<flatbuffers::ForwardsUOffset<&str>>("name", Self::VT_NAME, false)?
4664 .finish();
4665 Ok(())
4666 }
4667}
4668pub struct ByNameArgs<'a> {
4669 pub name: Option<flatbuffers::WIPOffset<&'a str>>,
4670}
4671impl<'a> Default for ByNameArgs<'a> {
4672 #[inline]
4673 fn default() -> Self {
4674 ByNameArgs {
4675 name: None,
4676 }
4677 }
4678}
4679
4680pub struct ByNameBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
4681 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
4682 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
4683}
4684impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> ByNameBuilder<'a, 'b, A> {
4685 #[inline]
4686 pub fn add_name(&mut self, name: flatbuffers::WIPOffset<&'b str>) {
4687 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(ByName::VT_NAME, name);
4688 }
4689 #[inline]
4690 pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> ByNameBuilder<'a, 'b, A> {
4691 let start = _fbb.start_table();
4692 ByNameBuilder {
4693 fbb_: _fbb,
4694 start_: start,
4695 }
4696 }
4697 #[inline]
4698 pub fn finish(self) -> flatbuffers::WIPOffset<ByName<'a>> {
4699 let o = self.fbb_.end_table(self.start_);
4700 flatbuffers::WIPOffset::new(o.value())
4701 }
4702}
4703
4704impl core::fmt::Debug for ByName<'_> {
4705 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
4706 let mut ds = f.debug_struct("ByName");
4707 ds.field("name", &self.name());
4708 ds.finish()
4709 }
4710}
4711pub enum FilterOffset {}
4712#[derive(Copy, Clone, PartialEq)]
4713
4714pub struct Filter<'a> {
4715 pub _tab: flatbuffers::Table<'a>,
4716}
4717
4718impl<'a> flatbuffers::Follow<'a> for Filter<'a> {
4719 type Inner = Filter<'a>;
4720 #[inline]
4721 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
4722 Self { _tab: flatbuffers::Table::new(buf, loc) }
4723 }
4724}
4725
4726impl<'a> Filter<'a> {
4727 pub const VT_FILTER_TYPE_TYPE: flatbuffers::VOffsetT = 4;
4728 pub const VT_FILTER_TYPE: flatbuffers::VOffsetT = 6;
4729
4730 #[inline]
4731 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
4732 Filter { _tab: table }
4733 }
4734 #[allow(unused_mut)]
4735 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
4736 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
4737 args: &'args FilterArgs
4738 ) -> flatbuffers::WIPOffset<Filter<'bldr>> {
4739 let mut builder = FilterBuilder::new(_fbb);
4740 if let Some(x) = args.filter_type { builder.add_filter_type(x); }
4741 builder.add_filter_type_type(args.filter_type_type);
4742 builder.finish()
4743 }
4744
4745
4746 #[inline]
4747 pub fn filter_type_type(&self) -> FilterType {
4748 unsafe { self._tab.get::<FilterType>(Filter::VT_FILTER_TYPE_TYPE, Some(FilterType::NONE)).unwrap()}
4752 }
4753 #[inline]
4754 pub fn filter_type(&self) -> Option<flatbuffers::Table<'a>> {
4755 unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Table<'a>>>(Filter::VT_FILTER_TYPE, None)}
4759 }
4760 #[inline]
4761 #[allow(non_snake_case)]
4762 pub fn filter_type_as_by_name(&self) -> Option<ByName<'a>> {
4763 if self.filter_type_type() == FilterType::ByName {
4764 self.filter_type().map(|t| {
4765 unsafe { ByName::init_from_table(t) }
4769 })
4770 } else {
4771 None
4772 }
4773 }
4774
4775}
4776
4777impl flatbuffers::Verifiable for Filter<'_> {
4778 #[inline]
4779 fn run_verifier(
4780 v: &mut flatbuffers::Verifier, pos: usize
4781 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
4782 use self::flatbuffers::Verifiable;
4783 v.visit_table(pos)?
4784 .visit_union::<FilterType, _>("filter_type_type", Self::VT_FILTER_TYPE_TYPE, "filter_type", Self::VT_FILTER_TYPE, false, |key, v, pos| {
4785 match key {
4786 FilterType::ByName => v.verify_union_variant::<flatbuffers::ForwardsUOffset<ByName>>("FilterType::ByName", pos),
4787 _ => Ok(()),
4788 }
4789 })?
4790 .finish();
4791 Ok(())
4792 }
4793}
4794pub struct FilterArgs {
4795 pub filter_type_type: FilterType,
4796 pub filter_type: Option<flatbuffers::WIPOffset<flatbuffers::UnionWIPOffset>>,
4797}
4798impl<'a> Default for FilterArgs {
4799 #[inline]
4800 fn default() -> Self {
4801 FilterArgs {
4802 filter_type_type: FilterType::NONE,
4803 filter_type: None,
4804 }
4805 }
4806}
4807
4808pub struct FilterBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
4809 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
4810 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
4811}
4812impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> FilterBuilder<'a, 'b, A> {
4813 #[inline]
4814 pub fn add_filter_type_type(&mut self, filter_type_type: FilterType) {
4815 self.fbb_.push_slot::<FilterType>(Filter::VT_FILTER_TYPE_TYPE, filter_type_type, FilterType::NONE);
4816 }
4817 #[inline]
4818 pub fn add_filter_type(&mut self, filter_type: flatbuffers::WIPOffset<flatbuffers::UnionWIPOffset>) {
4819 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Filter::VT_FILTER_TYPE, filter_type);
4820 }
4821 #[inline]
4822 pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> FilterBuilder<'a, 'b, A> {
4823 let start = _fbb.start_table();
4824 FilterBuilder {
4825 fbb_: _fbb,
4826 start_: start,
4827 }
4828 }
4829 #[inline]
4830 pub fn finish(self) -> flatbuffers::WIPOffset<Filter<'a>> {
4831 let o = self.fbb_.end_table(self.start_);
4832 flatbuffers::WIPOffset::new(o.value())
4833 }
4834}
4835
4836impl core::fmt::Debug for Filter<'_> {
4837 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
4838 let mut ds = f.debug_struct("Filter");
4839 ds.field("filter_type_type", &self.filter_type_type());
4840 match self.filter_type_type() {
4841 FilterType::ByName => {
4842 if let Some(x) = self.filter_type_as_by_name() {
4843 ds.field("filter_type", &x)
4844 } else {
4845 ds.field("filter_type", &"InvalidFlatbuffer: Union discriminant does not match value.")
4846 }
4847 },
4848 _ => {
4849 let x: Option<()> = None;
4850 ds.field("filter_type", &x)
4851 },
4852 };
4853 ds.finish()
4854 }
4855}
4856pub enum GetPlansRequestOffset {}
4857#[derive(Copy, Clone, PartialEq)]
4858
4859pub struct GetPlansRequest<'a> {
4860 pub _tab: flatbuffers::Table<'a>,
4861}
4862
4863impl<'a> flatbuffers::Follow<'a> for GetPlansRequest<'a> {
4864 type Inner = GetPlansRequest<'a>;
4865 #[inline]
4866 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
4867 Self { _tab: flatbuffers::Table::new(buf, loc) }
4868 }
4869}
4870
4871impl<'a> GetPlansRequest<'a> {
4872 pub const VT_NAME: flatbuffers::VOffsetT = 4;
4873
4874 #[inline]
4875 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
4876 GetPlansRequest { _tab: table }
4877 }
4878 #[allow(unused_mut)]
4879 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
4880 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
4881 args: &'args GetPlansRequestArgs<'args>
4882 ) -> flatbuffers::WIPOffset<GetPlansRequest<'bldr>> {
4883 let mut builder = GetPlansRequestBuilder::new(_fbb);
4884 if let Some(x) = args.name { builder.add_name(x); }
4885 builder.finish()
4886 }
4887
4888
4889 #[inline]
4890 pub fn name(&self) -> Option<Filter<'a>> {
4891 unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<Filter>>(GetPlansRequest::VT_NAME, None)}
4895 }
4896}
4897
4898impl flatbuffers::Verifiable for GetPlansRequest<'_> {
4899 #[inline]
4900 fn run_verifier(
4901 v: &mut flatbuffers::Verifier, pos: usize
4902 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
4903 use self::flatbuffers::Verifiable;
4904 v.visit_table(pos)?
4905 .visit_field::<flatbuffers::ForwardsUOffset<Filter>>("name", Self::VT_NAME, false)?
4906 .finish();
4907 Ok(())
4908 }
4909}
4910pub struct GetPlansRequestArgs<'a> {
4911 pub name: Option<flatbuffers::WIPOffset<Filter<'a>>>,
4912}
4913impl<'a> Default for GetPlansRequestArgs<'a> {
4914 #[inline]
4915 fn default() -> Self {
4916 GetPlansRequestArgs {
4917 name: None,
4918 }
4919 }
4920}
4921
4922pub struct GetPlansRequestBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
4923 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
4924 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
4925}
4926impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> GetPlansRequestBuilder<'a, 'b, A> {
4927 #[inline]
4928 pub fn add_name(&mut self, name: flatbuffers::WIPOffset<Filter<'b >>) {
4929 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<Filter>>(GetPlansRequest::VT_NAME, name);
4930 }
4931 #[inline]
4932 pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> GetPlansRequestBuilder<'a, 'b, A> {
4933 let start = _fbb.start_table();
4934 GetPlansRequestBuilder {
4935 fbb_: _fbb,
4936 start_: start,
4937 }
4938 }
4939 #[inline]
4940 pub fn finish(self) -> flatbuffers::WIPOffset<GetPlansRequest<'a>> {
4941 let o = self.fbb_.end_table(self.start_);
4942 flatbuffers::WIPOffset::new(o.value())
4943 }
4944}
4945
4946impl core::fmt::Debug for GetPlansRequest<'_> {
4947 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
4948 let mut ds = f.debug_struct("GetPlansRequest");
4949 ds.field("name", &self.name());
4950 ds.finish()
4951 }
4952}
4953pub enum GetPlanRequestOffset {}
4954#[derive(Copy, Clone, PartialEq)]
4955
4956pub struct GetPlanRequest<'a> {
4957 pub _tab: flatbuffers::Table<'a>,
4958}
4959
4960impl<'a> flatbuffers::Follow<'a> for GetPlanRequest<'a> {
4961 type Inner = GetPlanRequest<'a>;
4962 #[inline]
4963 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
4964 Self { _tab: flatbuffers::Table::new(buf, loc) }
4965 }
4966}
4967
4968impl<'a> GetPlanRequest<'a> {
4969 pub const VT_ID: flatbuffers::VOffsetT = 4;
4970
4971 #[inline]
4972 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
4973 GetPlanRequest { _tab: table }
4974 }
4975 #[allow(unused_mut)]
4976 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
4977 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
4978 args: &'args GetPlanRequestArgs
4979 ) -> flatbuffers::WIPOffset<GetPlanRequest<'bldr>> {
4980 let mut builder = GetPlanRequestBuilder::new(_fbb);
4981 builder.add_id(args.id);
4982 builder.finish()
4983 }
4984
4985
4986 #[inline]
4987 pub fn id(&self) -> u64 {
4988 unsafe { self._tab.get::<u64>(GetPlanRequest::VT_ID, Some(0)).unwrap()}
4992 }
4993}
4994
4995impl flatbuffers::Verifiable for GetPlanRequest<'_> {
4996 #[inline]
4997 fn run_verifier(
4998 v: &mut flatbuffers::Verifier, pos: usize
4999 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
5000 use self::flatbuffers::Verifiable;
5001 v.visit_table(pos)?
5002 .visit_field::<u64>("id", Self::VT_ID, false)?
5003 .finish();
5004 Ok(())
5005 }
5006}
5007pub struct GetPlanRequestArgs {
5008 pub id: u64,
5009}
5010impl<'a> Default for GetPlanRequestArgs {
5011 #[inline]
5012 fn default() -> Self {
5013 GetPlanRequestArgs {
5014 id: 0,
5015 }
5016 }
5017}
5018
5019pub struct GetPlanRequestBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
5020 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
5021 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
5022}
5023impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> GetPlanRequestBuilder<'a, 'b, A> {
5024 #[inline]
5025 pub fn add_id(&mut self, id: u64) {
5026 self.fbb_.push_slot::<u64>(GetPlanRequest::VT_ID, id, 0);
5027 }
5028 #[inline]
5029 pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> GetPlanRequestBuilder<'a, 'b, A> {
5030 let start = _fbb.start_table();
5031 GetPlanRequestBuilder {
5032 fbb_: _fbb,
5033 start_: start,
5034 }
5035 }
5036 #[inline]
5037 pub fn finish(self) -> flatbuffers::WIPOffset<GetPlanRequest<'a>> {
5038 let o = self.fbb_.end_table(self.start_);
5039 flatbuffers::WIPOffset::new(o.value())
5040 }
5041}
5042
5043impl core::fmt::Debug for GetPlanRequest<'_> {
5044 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
5045 let mut ds = f.debug_struct("GetPlanRequest");
5046 ds.field("id", &self.id());
5047 ds.finish()
5048 }
5049}
5050pub enum ErrorStatusOffset {}
5051#[derive(Copy, Clone, PartialEq)]
5052
5053pub struct ErrorStatus<'a> {
5054 pub _tab: flatbuffers::Table<'a>,
5055}
5056
5057impl<'a> flatbuffers::Follow<'a> for ErrorStatus<'a> {
5058 type Inner = ErrorStatus<'a>;
5059 #[inline]
5060 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
5061 Self { _tab: flatbuffers::Table::new(buf, loc) }
5062 }
5063}
5064
5065impl<'a> ErrorStatus<'a> {
5066 pub const VT_CODE: flatbuffers::VOffsetT = 4;
5067 pub const VT_MSG: flatbuffers::VOffsetT = 6;
5068
5069 #[inline]
5070 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
5071 ErrorStatus { _tab: table }
5072 }
5073 #[allow(unused_mut)]
5074 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
5075 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
5076 args: &'args ErrorStatusArgs<'args>
5077 ) -> flatbuffers::WIPOffset<ErrorStatus<'bldr>> {
5078 let mut builder = ErrorStatusBuilder::new(_fbb);
5079 if let Some(x) = args.msg { builder.add_msg(x); }
5080 builder.add_code(args.code);
5081 builder.finish()
5082 }
5083
5084
5085 #[inline]
5086 pub fn code(&self) -> u32 {
5087 unsafe { self._tab.get::<u32>(ErrorStatus::VT_CODE, Some(0)).unwrap()}
5091 }
5092 #[inline]
5093 pub fn msg(&self) -> &'a str {
5094 unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<&str>>(ErrorStatus::VT_MSG, None).unwrap()}
5098 }
5099}
5100
5101impl flatbuffers::Verifiable for ErrorStatus<'_> {
5102 #[inline]
5103 fn run_verifier(
5104 v: &mut flatbuffers::Verifier, pos: usize
5105 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
5106 use self::flatbuffers::Verifiable;
5107 v.visit_table(pos)?
5108 .visit_field::<u32>("code", Self::VT_CODE, false)?
5109 .visit_field::<flatbuffers::ForwardsUOffset<&str>>("msg", Self::VT_MSG, true)?
5110 .finish();
5111 Ok(())
5112 }
5113}
5114pub struct ErrorStatusArgs<'a> {
5115 pub code: u32,
5116 pub msg: Option<flatbuffers::WIPOffset<&'a str>>,
5117}
5118impl<'a> Default for ErrorStatusArgs<'a> {
5119 #[inline]
5120 fn default() -> Self {
5121 ErrorStatusArgs {
5122 code: 0,
5123 msg: None, }
5125 }
5126}
5127
5128pub struct ErrorStatusBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
5129 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
5130 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
5131}
5132impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> ErrorStatusBuilder<'a, 'b, A> {
5133 #[inline]
5134 pub fn add_code(&mut self, code: u32) {
5135 self.fbb_.push_slot::<u32>(ErrorStatus::VT_CODE, code, 0);
5136 }
5137 #[inline]
5138 pub fn add_msg(&mut self, msg: flatbuffers::WIPOffset<&'b str>) {
5139 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(ErrorStatus::VT_MSG, msg);
5140 }
5141 #[inline]
5142 pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> ErrorStatusBuilder<'a, 'b, A> {
5143 let start = _fbb.start_table();
5144 ErrorStatusBuilder {
5145 fbb_: _fbb,
5146 start_: start,
5147 }
5148 }
5149 #[inline]
5150 pub fn finish(self) -> flatbuffers::WIPOffset<ErrorStatus<'a>> {
5151 let o = self.fbb_.end_table(self.start_);
5152 self.fbb_.required(o, ErrorStatus::VT_MSG,"msg");
5153 flatbuffers::WIPOffset::new(o.value())
5154 }
5155}
5156
5157impl core::fmt::Debug for ErrorStatus<'_> {
5158 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
5159 let mut ds = f.debug_struct("ErrorStatus");
5160 ds.field("code", &self.code());
5161 ds.field("msg", &self.msg());
5162 ds.finish()
5163 }
5164}
5165pub enum OkStatusOffset {}
5166#[derive(Copy, Clone, PartialEq)]
5167
5168pub struct OkStatus<'a> {
5169 pub _tab: flatbuffers::Table<'a>,
5170}
5171
5172impl<'a> flatbuffers::Follow<'a> for OkStatus<'a> {
5173 type Inner = OkStatus<'a>;
5174 #[inline]
5175 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
5176 Self { _tab: flatbuffers::Table::new(buf, loc) }
5177 }
5178}
5179
5180impl<'a> OkStatus<'a> {
5181
5182 #[inline]
5183 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
5184 OkStatus { _tab: table }
5185 }
5186 #[allow(unused_mut)]
5187 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
5188 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
5189 _args: &'args OkStatusArgs
5190 ) -> flatbuffers::WIPOffset<OkStatus<'bldr>> {
5191 let mut builder = OkStatusBuilder::new(_fbb);
5192 builder.finish()
5193 }
5194
5195}
5196
5197impl flatbuffers::Verifiable for OkStatus<'_> {
5198 #[inline]
5199 fn run_verifier(
5200 v: &mut flatbuffers::Verifier, pos: usize
5201 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
5202 use self::flatbuffers::Verifiable;
5203 v.visit_table(pos)?
5204 .finish();
5205 Ok(())
5206 }
5207}
5208pub struct OkStatusArgs {
5209}
5210impl<'a> Default for OkStatusArgs {
5211 #[inline]
5212 fn default() -> Self {
5213 OkStatusArgs {
5214 }
5215 }
5216}
5217
5218pub struct OkStatusBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
5219 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
5220 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
5221}
5222impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> OkStatusBuilder<'a, 'b, A> {
5223 #[inline]
5224 pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> OkStatusBuilder<'a, 'b, A> {
5225 let start = _fbb.start_table();
5226 OkStatusBuilder {
5227 fbb_: _fbb,
5228 start_: start,
5229 }
5230 }
5231 #[inline]
5232 pub fn finish(self) -> flatbuffers::WIPOffset<OkStatus<'a>> {
5233 let o = self.fbb_.end_table(self.start_);
5234 flatbuffers::WIPOffset::new(o.value())
5235 }
5236}
5237
5238impl core::fmt::Debug for OkStatus<'_> {
5239 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
5240 let mut ds = f.debug_struct("OkStatus");
5241 ds.finish()
5242 }
5243}
5244pub enum BindRequestOffset {}
5245#[derive(Copy, Clone, PartialEq)]
5246
5247pub struct BindRequest<'a> {
5248 pub _tab: flatbuffers::Table<'a>,
5249}
5250
5251impl<'a> flatbuffers::Follow<'a> for BindRequest<'a> {
5252 type Inner = BindRequest<'a>;
5253 #[inline]
5254 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
5255 Self { _tab: flatbuffers::Table::new(buf, loc) }
5256 }
5257}
5258
5259impl<'a> BindRequest<'a> {
5260 pub const VT_PLAN_ID: flatbuffers::VOffsetT = 4;
5261 pub const VT_STOP_ID: flatbuffers::VOffsetT = 6;
5262
5263 #[inline]
5264 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
5265 BindRequest { _tab: table }
5266 }
5267 #[allow(unused_mut)]
5268 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
5269 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
5270 args: &'args BindRequestArgs
5271 ) -> flatbuffers::WIPOffset<BindRequest<'bldr>> {
5272 let mut builder = BindRequestBuilder::new(_fbb);
5273 builder.add_stop_id(args.stop_id);
5274 builder.add_plan_id(args.plan_id);
5275 builder.finish()
5276 }
5277
5278
5279 #[inline]
5280 pub fn plan_id(&self) -> u64 {
5281 unsafe { self._tab.get::<u64>(BindRequest::VT_PLAN_ID, Some(0)).unwrap()}
5285 }
5286 #[inline]
5287 pub fn stop_id(&self) -> u64 {
5288 unsafe { self._tab.get::<u64>(BindRequest::VT_STOP_ID, Some(0)).unwrap()}
5292 }
5293}
5294
5295impl flatbuffers::Verifiable for BindRequest<'_> {
5296 #[inline]
5297 fn run_verifier(
5298 v: &mut flatbuffers::Verifier, pos: usize
5299 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
5300 use self::flatbuffers::Verifiable;
5301 v.visit_table(pos)?
5302 .visit_field::<u64>("plan_id", Self::VT_PLAN_ID, false)?
5303 .visit_field::<u64>("stop_id", Self::VT_STOP_ID, false)?
5304 .finish();
5305 Ok(())
5306 }
5307}
5308pub struct BindRequestArgs {
5309 pub plan_id: u64,
5310 pub stop_id: u64,
5311}
5312impl<'a> Default for BindRequestArgs {
5313 #[inline]
5314 fn default() -> Self {
5315 BindRequestArgs {
5316 plan_id: 0,
5317 stop_id: 0,
5318 }
5319 }
5320}
5321
5322pub struct BindRequestBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
5323 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
5324 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
5325}
5326impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> BindRequestBuilder<'a, 'b, A> {
5327 #[inline]
5328 pub fn add_plan_id(&mut self, plan_id: u64) {
5329 self.fbb_.push_slot::<u64>(BindRequest::VT_PLAN_ID, plan_id, 0);
5330 }
5331 #[inline]
5332 pub fn add_stop_id(&mut self, stop_id: u64) {
5333 self.fbb_.push_slot::<u64>(BindRequest::VT_STOP_ID, stop_id, 0);
5334 }
5335 #[inline]
5336 pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> BindRequestBuilder<'a, 'b, A> {
5337 let start = _fbb.start_table();
5338 BindRequestBuilder {
5339 fbb_: _fbb,
5340 start_: start,
5341 }
5342 }
5343 #[inline]
5344 pub fn finish(self) -> flatbuffers::WIPOffset<BindRequest<'a>> {
5345 let o = self.fbb_.end_table(self.start_);
5346 flatbuffers::WIPOffset::new(o.value())
5347 }
5348}
5349
5350impl core::fmt::Debug for BindRequest<'_> {
5351 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
5352 let mut ds = f.debug_struct("BindRequest");
5353 ds.field("plan_id", &self.plan_id());
5354 ds.field("stop_id", &self.stop_id());
5355 ds.finish()
5356 }
5357}
5358pub enum BindResponseOffset {}
5359#[derive(Copy, Clone, PartialEq)]
5360
5361pub struct BindResponse<'a> {
5362 pub _tab: flatbuffers::Table<'a>,
5363}
5364
5365impl<'a> flatbuffers::Follow<'a> for BindResponse<'a> {
5366 type Inner = BindResponse<'a>;
5367 #[inline]
5368 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
5369 Self { _tab: flatbuffers::Table::new(buf, loc) }
5370 }
5371}
5372
5373impl<'a> BindResponse<'a> {
5374 pub const VT_PLAN_ID: flatbuffers::VOffsetT = 4;
5375 pub const VT_STOP_ID: flatbuffers::VOffsetT = 6;
5376
5377 #[inline]
5378 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
5379 BindResponse { _tab: table }
5380 }
5381 #[allow(unused_mut)]
5382 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
5383 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
5384 args: &'args BindResponseArgs
5385 ) -> flatbuffers::WIPOffset<BindResponse<'bldr>> {
5386 let mut builder = BindResponseBuilder::new(_fbb);
5387 builder.add_stop_id(args.stop_id);
5388 builder.add_plan_id(args.plan_id);
5389 builder.finish()
5390 }
5391
5392
5393 #[inline]
5394 pub fn plan_id(&self) -> u64 {
5395 unsafe { self._tab.get::<u64>(BindResponse::VT_PLAN_ID, Some(0)).unwrap()}
5399 }
5400 #[inline]
5401 pub fn stop_id(&self) -> u64 {
5402 unsafe { self._tab.get::<u64>(BindResponse::VT_STOP_ID, Some(0)).unwrap()}
5406 }
5407}
5408
5409impl flatbuffers::Verifiable for BindResponse<'_> {
5410 #[inline]
5411 fn run_verifier(
5412 v: &mut flatbuffers::Verifier, pos: usize
5413 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
5414 use self::flatbuffers::Verifiable;
5415 v.visit_table(pos)?
5416 .visit_field::<u64>("plan_id", Self::VT_PLAN_ID, false)?
5417 .visit_field::<u64>("stop_id", Self::VT_STOP_ID, false)?
5418 .finish();
5419 Ok(())
5420 }
5421}
5422pub struct BindResponseArgs {
5423 pub plan_id: u64,
5424 pub stop_id: u64,
5425}
5426impl<'a> Default for BindResponseArgs {
5427 #[inline]
5428 fn default() -> Self {
5429 BindResponseArgs {
5430 plan_id: 0,
5431 stop_id: 0,
5432 }
5433 }
5434}
5435
5436pub struct BindResponseBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
5437 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
5438 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
5439}
5440impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> BindResponseBuilder<'a, 'b, A> {
5441 #[inline]
5442 pub fn add_plan_id(&mut self, plan_id: u64) {
5443 self.fbb_.push_slot::<u64>(BindResponse::VT_PLAN_ID, plan_id, 0);
5444 }
5445 #[inline]
5446 pub fn add_stop_id(&mut self, stop_id: u64) {
5447 self.fbb_.push_slot::<u64>(BindResponse::VT_STOP_ID, stop_id, 0);
5448 }
5449 #[inline]
5450 pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> BindResponseBuilder<'a, 'b, A> {
5451 let start = _fbb.start_table();
5452 BindResponseBuilder {
5453 fbb_: _fbb,
5454 start_: start,
5455 }
5456 }
5457 #[inline]
5458 pub fn finish(self) -> flatbuffers::WIPOffset<BindResponse<'a>> {
5459 let o = self.fbb_.end_table(self.start_);
5460 flatbuffers::WIPOffset::new(o.value())
5461 }
5462}
5463
5464impl core::fmt::Debug for BindResponse<'_> {
5465 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
5466 let mut ds = f.debug_struct("BindResponse");
5467 ds.field("plan_id", &self.plan_id());
5468 ds.field("stop_id", &self.stop_id());
5469 ds.finish()
5470 }
5471}
5472pub enum UnbindRequestOffset {}
5473#[derive(Copy, Clone, PartialEq)]
5474
5475pub struct UnbindRequest<'a> {
5476 pub _tab: flatbuffers::Table<'a>,
5477}
5478
5479impl<'a> flatbuffers::Follow<'a> for UnbindRequest<'a> {
5480 type Inner = UnbindRequest<'a>;
5481 #[inline]
5482 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
5483 Self { _tab: flatbuffers::Table::new(buf, loc) }
5484 }
5485}
5486
5487impl<'a> UnbindRequest<'a> {
5488 pub const VT_PLAN_ID: flatbuffers::VOffsetT = 4;
5489 pub const VT_STOP_ID: flatbuffers::VOffsetT = 6;
5490
5491 #[inline]
5492 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
5493 UnbindRequest { _tab: table }
5494 }
5495 #[allow(unused_mut)]
5496 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
5497 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
5498 args: &'args UnbindRequestArgs
5499 ) -> flatbuffers::WIPOffset<UnbindRequest<'bldr>> {
5500 let mut builder = UnbindRequestBuilder::new(_fbb);
5501 builder.add_stop_id(args.stop_id);
5502 builder.add_plan_id(args.plan_id);
5503 builder.finish()
5504 }
5505
5506
5507 #[inline]
5508 pub fn plan_id(&self) -> u64 {
5509 unsafe { self._tab.get::<u64>(UnbindRequest::VT_PLAN_ID, Some(0)).unwrap()}
5513 }
5514 #[inline]
5515 pub fn stop_id(&self) -> u64 {
5516 unsafe { self._tab.get::<u64>(UnbindRequest::VT_STOP_ID, Some(0)).unwrap()}
5520 }
5521}
5522
5523impl flatbuffers::Verifiable for UnbindRequest<'_> {
5524 #[inline]
5525 fn run_verifier(
5526 v: &mut flatbuffers::Verifier, pos: usize
5527 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
5528 use self::flatbuffers::Verifiable;
5529 v.visit_table(pos)?
5530 .visit_field::<u64>("plan_id", Self::VT_PLAN_ID, false)?
5531 .visit_field::<u64>("stop_id", Self::VT_STOP_ID, false)?
5532 .finish();
5533 Ok(())
5534 }
5535}
5536pub struct UnbindRequestArgs {
5537 pub plan_id: u64,
5538 pub stop_id: u64,
5539}
5540impl<'a> Default for UnbindRequestArgs {
5541 #[inline]
5542 fn default() -> Self {
5543 UnbindRequestArgs {
5544 plan_id: 0,
5545 stop_id: 0,
5546 }
5547 }
5548}
5549
5550pub struct UnbindRequestBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
5551 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
5552 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
5553}
5554impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> UnbindRequestBuilder<'a, 'b, A> {
5555 #[inline]
5556 pub fn add_plan_id(&mut self, plan_id: u64) {
5557 self.fbb_.push_slot::<u64>(UnbindRequest::VT_PLAN_ID, plan_id, 0);
5558 }
5559 #[inline]
5560 pub fn add_stop_id(&mut self, stop_id: u64) {
5561 self.fbb_.push_slot::<u64>(UnbindRequest::VT_STOP_ID, stop_id, 0);
5562 }
5563 #[inline]
5564 pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> UnbindRequestBuilder<'a, 'b, A> {
5565 let start = _fbb.start_table();
5566 UnbindRequestBuilder {
5567 fbb_: _fbb,
5568 start_: start,
5569 }
5570 }
5571 #[inline]
5572 pub fn finish(self) -> flatbuffers::WIPOffset<UnbindRequest<'a>> {
5573 let o = self.fbb_.end_table(self.start_);
5574 flatbuffers::WIPOffset::new(o.value())
5575 }
5576}
5577
5578impl core::fmt::Debug for UnbindRequest<'_> {
5579 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
5580 let mut ds = f.debug_struct("UnbindRequest");
5581 ds.field("plan_id", &self.plan_id());
5582 ds.field("stop_id", &self.stop_id());
5583 ds.finish()
5584 }
5585}
5586pub enum UnbindResponseOffset {}
5587#[derive(Copy, Clone, PartialEq)]
5588
5589pub struct UnbindResponse<'a> {
5590 pub _tab: flatbuffers::Table<'a>,
5591}
5592
5593impl<'a> flatbuffers::Follow<'a> for UnbindResponse<'a> {
5594 type Inner = UnbindResponse<'a>;
5595 #[inline]
5596 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
5597 Self { _tab: flatbuffers::Table::new(buf, loc) }
5598 }
5599}
5600
5601impl<'a> UnbindResponse<'a> {
5602 pub const VT_PLAN_ID: flatbuffers::VOffsetT = 4;
5603 pub const VT_STOP_ID: flatbuffers::VOffsetT = 6;
5604
5605 #[inline]
5606 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
5607 UnbindResponse { _tab: table }
5608 }
5609 #[allow(unused_mut)]
5610 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
5611 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
5612 args: &'args UnbindResponseArgs
5613 ) -> flatbuffers::WIPOffset<UnbindResponse<'bldr>> {
5614 let mut builder = UnbindResponseBuilder::new(_fbb);
5615 builder.add_stop_id(args.stop_id);
5616 builder.add_plan_id(args.plan_id);
5617 builder.finish()
5618 }
5619
5620
5621 #[inline]
5622 pub fn plan_id(&self) -> u64 {
5623 unsafe { self._tab.get::<u64>(UnbindResponse::VT_PLAN_ID, Some(0)).unwrap()}
5627 }
5628 #[inline]
5629 pub fn stop_id(&self) -> u64 {
5630 unsafe { self._tab.get::<u64>(UnbindResponse::VT_STOP_ID, Some(0)).unwrap()}
5634 }
5635}
5636
5637impl flatbuffers::Verifiable for UnbindResponse<'_> {
5638 #[inline]
5639 fn run_verifier(
5640 v: &mut flatbuffers::Verifier, pos: usize
5641 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
5642 use self::flatbuffers::Verifiable;
5643 v.visit_table(pos)?
5644 .visit_field::<u64>("plan_id", Self::VT_PLAN_ID, false)?
5645 .visit_field::<u64>("stop_id", Self::VT_STOP_ID, false)?
5646 .finish();
5647 Ok(())
5648 }
5649}
5650pub struct UnbindResponseArgs {
5651 pub plan_id: u64,
5652 pub stop_id: u64,
5653}
5654impl<'a> Default for UnbindResponseArgs {
5655 #[inline]
5656 fn default() -> Self {
5657 UnbindResponseArgs {
5658 plan_id: 0,
5659 stop_id: 0,
5660 }
5661 }
5662}
5663
5664pub struct UnbindResponseBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
5665 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
5666 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
5667}
5668impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> UnbindResponseBuilder<'a, 'b, A> {
5669 #[inline]
5670 pub fn add_plan_id(&mut self, plan_id: u64) {
5671 self.fbb_.push_slot::<u64>(UnbindResponse::VT_PLAN_ID, plan_id, 0);
5672 }
5673 #[inline]
5674 pub fn add_stop_id(&mut self, stop_id: u64) {
5675 self.fbb_.push_slot::<u64>(UnbindResponse::VT_STOP_ID, stop_id, 0);
5676 }
5677 #[inline]
5678 pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> UnbindResponseBuilder<'a, 'b, A> {
5679 let start = _fbb.start_table();
5680 UnbindResponseBuilder {
5681 fbb_: _fbb,
5682 start_: start,
5683 }
5684 }
5685 #[inline]
5686 pub fn finish(self) -> flatbuffers::WIPOffset<UnbindResponse<'a>> {
5687 let o = self.fbb_.end_table(self.start_);
5688 flatbuffers::WIPOffset::new(o.value())
5689 }
5690}
5691
5692impl core::fmt::Debug for UnbindResponse<'_> {
5693 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
5694 let mut ds = f.debug_struct("UnbindResponse");
5695 ds.field("plan_id", &self.plan_id());
5696 ds.field("stop_id", &self.stop_id());
5697 ds.finish()
5698 }
5699}
5700pub enum MessageOffset {}
5701#[derive(Copy, Clone, PartialEq)]
5702
5703pub struct Message<'a> {
5704 pub _tab: flatbuffers::Table<'a>,
5705}
5706
5707impl<'a> flatbuffers::Follow<'a> for Message<'a> {
5708 type Inner = Message<'a>;
5709 #[inline]
5710 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
5711 Self { _tab: flatbuffers::Table::new(buf, loc) }
5712 }
5713}
5714
5715impl<'a> Message<'a> {
5716 pub const VT_DATA_TYPE: flatbuffers::VOffsetT = 4;
5717 pub const VT_DATA: flatbuffers::VOffsetT = 6;
5718 pub const VT_STATUS_TYPE: flatbuffers::VOffsetT = 8;
5719 pub const VT_STATUS: flatbuffers::VOffsetT = 10;
5720
5721 #[inline]
5722 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
5723 Message { _tab: table }
5724 }
5725 #[allow(unused_mut)]
5726 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
5727 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
5728 args: &'args MessageArgs
5729 ) -> flatbuffers::WIPOffset<Message<'bldr>> {
5730 let mut builder = MessageBuilder::new(_fbb);
5731 if let Some(x) = args.status { builder.add_status(x); }
5732 if let Some(x) = args.data { builder.add_data(x); }
5733 builder.add_status_type(args.status_type);
5734 builder.add_data_type(args.data_type);
5735 builder.finish()
5736 }
5737
5738
5739 #[inline]
5740 pub fn data_type(&self) -> Payload {
5741 unsafe { self._tab.get::<Payload>(Message::VT_DATA_TYPE, Some(Payload::NONE)).unwrap()}
5745 }
5746 #[inline]
5747 pub fn data(&self) -> flatbuffers::Table<'a> {
5748 unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Table<'a>>>(Message::VT_DATA, None).unwrap()}
5752 }
5753 #[inline]
5754 pub fn status_type(&self) -> Status {
5755 unsafe { self._tab.get::<Status>(Message::VT_STATUS_TYPE, Some(Status::NONE)).unwrap()}
5759 }
5760 #[inline]
5761 pub fn status(&self) -> flatbuffers::Table<'a> {
5762 unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Table<'a>>>(Message::VT_STATUS, None).unwrap()}
5766 }
5767 #[inline]
5768 #[allow(non_snake_case)]
5769 pub fn data_as_create_plan_request(&self) -> Option<CreatePlanRequest<'a>> {
5770 if self.data_type() == Payload::CreatePlanRequest {
5771 let u = self.data();
5772 Some(unsafe { CreatePlanRequest::init_from_table(u) })
5776 } else {
5777 None
5778 }
5779 }
5780
5781 #[inline]
5782 #[allow(non_snake_case)]
5783 pub fn data_as_create_plan_response(&self) -> Option<CreatePlanResponse<'a>> {
5784 if self.data_type() == Payload::CreatePlanResponse {
5785 let u = self.data();
5786 Some(unsafe { CreatePlanResponse::init_from_table(u) })
5790 } else {
5791 None
5792 }
5793 }
5794
5795 #[inline]
5796 #[allow(non_snake_case)]
5797 pub fn data_as_get_plan_request(&self) -> Option<GetPlanRequest<'a>> {
5798 if self.data_type() == Payload::GetPlanRequest {
5799 let u = self.data();
5800 Some(unsafe { GetPlanRequest::init_from_table(u) })
5804 } else {
5805 None
5806 }
5807 }
5808
5809 #[inline]
5810 #[allow(non_snake_case)]
5811 pub fn data_as_get_plans_request(&self) -> Option<GetPlansRequest<'a>> {
5812 if self.data_type() == Payload::GetPlansRequest {
5813 let u = self.data();
5814 Some(unsafe { GetPlansRequest::init_from_table(u) })
5818 } else {
5819 None
5820 }
5821 }
5822
5823 #[inline]
5824 #[allow(non_snake_case)]
5825 pub fn data_as_train(&self) -> Option<Train<'a>> {
5826 if self.data_type() == Payload::Train {
5827 let u = self.data();
5828 Some(unsafe { Train::init_from_table(u) })
5832 } else {
5833 None
5834 }
5835 }
5836
5837 #[inline]
5838 #[allow(non_snake_case)]
5839 pub fn data_as_catalog(&self) -> Option<Catalog<'a>> {
5840 if self.data_type() == Payload::Catalog {
5841 let u = self.data();
5842 Some(unsafe { Catalog::init_from_table(u) })
5846 } else {
5847 None
5848 }
5849 }
5850
5851 #[inline]
5852 #[allow(non_snake_case)]
5853 pub fn data_as_register_request(&self) -> Option<RegisterRequest<'a>> {
5854 if self.data_type() == Payload::RegisterRequest {
5855 let u = self.data();
5856 Some(unsafe { RegisterRequest::init_from_table(u) })
5860 } else {
5861 None
5862 }
5863 }
5864
5865 #[inline]
5866 #[allow(non_snake_case)]
5867 pub fn data_as_register_response(&self) -> Option<RegisterResponse<'a>> {
5868 if self.data_type() == Payload::RegisterResponse {
5869 let u = self.data();
5870 Some(unsafe { RegisterResponse::init_from_table(u) })
5874 } else {
5875 None
5876 }
5877 }
5878
5879 #[inline]
5880 #[allow(non_snake_case)]
5881 pub fn data_as_bind_request(&self) -> Option<BindRequest<'a>> {
5882 if self.data_type() == Payload::BindRequest {
5883 let u = self.data();
5884 Some(unsafe { BindRequest::init_from_table(u) })
5888 } else {
5889 None
5890 }
5891 }
5892
5893 #[inline]
5894 #[allow(non_snake_case)]
5895 pub fn data_as_bind_response(&self) -> Option<BindResponse<'a>> {
5896 if self.data_type() == Payload::BindResponse {
5897 let u = self.data();
5898 Some(unsafe { BindResponse::init_from_table(u) })
5902 } else {
5903 None
5904 }
5905 }
5906
5907 #[inline]
5908 #[allow(non_snake_case)]
5909 pub fn data_as_unbind_request(&self) -> Option<UnbindRequest<'a>> {
5910 if self.data_type() == Payload::UnbindRequest {
5911 let u = self.data();
5912 Some(unsafe { UnbindRequest::init_from_table(u) })
5916 } else {
5917 None
5918 }
5919 }
5920
5921 #[inline]
5922 #[allow(non_snake_case)]
5923 pub fn data_as_unbind_response(&self) -> Option<UnbindResponse<'a>> {
5924 if self.data_type() == Payload::UnbindResponse {
5925 let u = self.data();
5926 Some(unsafe { UnbindResponse::init_from_table(u) })
5930 } else {
5931 None
5932 }
5933 }
5934
5935 #[inline]
5936 #[allow(non_snake_case)]
5937 pub fn data_as_disconnect(&self) -> Option<Disconnect<'a>> {
5938 if self.data_type() == Payload::Disconnect {
5939 let u = self.data();
5940 Some(unsafe { Disconnect::init_from_table(u) })
5944 } else {
5945 None
5946 }
5947 }
5948
5949 #[inline]
5950 #[allow(non_snake_case)]
5951 pub fn status_as_ok_status(&self) -> Option<OkStatus<'a>> {
5952 if self.status_type() == Status::OkStatus {
5953 let u = self.status();
5954 Some(unsafe { OkStatus::init_from_table(u) })
5958 } else {
5959 None
5960 }
5961 }
5962
5963 #[inline]
5964 #[allow(non_snake_case)]
5965 pub fn status_as_error_status(&self) -> Option<ErrorStatus<'a>> {
5966 if self.status_type() == Status::ErrorStatus {
5967 let u = self.status();
5968 Some(unsafe { ErrorStatus::init_from_table(u) })
5972 } else {
5973 None
5974 }
5975 }
5976
5977}
5978
5979impl flatbuffers::Verifiable for Message<'_> {
5980 #[inline]
5981 fn run_verifier(
5982 v: &mut flatbuffers::Verifier, pos: usize
5983 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
5984 use self::flatbuffers::Verifiable;
5985 v.visit_table(pos)?
5986 .visit_union::<Payload, _>("data_type", Self::VT_DATA_TYPE, "data", Self::VT_DATA, true, |key, v, pos| {
5987 match key {
5988 Payload::CreatePlanRequest => v.verify_union_variant::<flatbuffers::ForwardsUOffset<CreatePlanRequest>>("Payload::CreatePlanRequest", pos),
5989 Payload::CreatePlanResponse => v.verify_union_variant::<flatbuffers::ForwardsUOffset<CreatePlanResponse>>("Payload::CreatePlanResponse", pos),
5990 Payload::GetPlanRequest => v.verify_union_variant::<flatbuffers::ForwardsUOffset<GetPlanRequest>>("Payload::GetPlanRequest", pos),
5991 Payload::GetPlansRequest => v.verify_union_variant::<flatbuffers::ForwardsUOffset<GetPlansRequest>>("Payload::GetPlansRequest", pos),
5992 Payload::Train => v.verify_union_variant::<flatbuffers::ForwardsUOffset<Train>>("Payload::Train", pos),
5993 Payload::Catalog => v.verify_union_variant::<flatbuffers::ForwardsUOffset<Catalog>>("Payload::Catalog", pos),
5994 Payload::RegisterRequest => v.verify_union_variant::<flatbuffers::ForwardsUOffset<RegisterRequest>>("Payload::RegisterRequest", pos),
5995 Payload::RegisterResponse => v.verify_union_variant::<flatbuffers::ForwardsUOffset<RegisterResponse>>("Payload::RegisterResponse", pos),
5996 Payload::BindRequest => v.verify_union_variant::<flatbuffers::ForwardsUOffset<BindRequest>>("Payload::BindRequest", pos),
5997 Payload::BindResponse => v.verify_union_variant::<flatbuffers::ForwardsUOffset<BindResponse>>("Payload::BindResponse", pos),
5998 Payload::UnbindRequest => v.verify_union_variant::<flatbuffers::ForwardsUOffset<UnbindRequest>>("Payload::UnbindRequest", pos),
5999 Payload::UnbindResponse => v.verify_union_variant::<flatbuffers::ForwardsUOffset<UnbindResponse>>("Payload::UnbindResponse", pos),
6000 Payload::Disconnect => v.verify_union_variant::<flatbuffers::ForwardsUOffset<Disconnect>>("Payload::Disconnect", pos),
6001 _ => Ok(()),
6002 }
6003 })?
6004 .visit_union::<Status, _>("status_type", Self::VT_STATUS_TYPE, "status", Self::VT_STATUS, true, |key, v, pos| {
6005 match key {
6006 Status::OkStatus => v.verify_union_variant::<flatbuffers::ForwardsUOffset<OkStatus>>("Status::OkStatus", pos),
6007 Status::ErrorStatus => v.verify_union_variant::<flatbuffers::ForwardsUOffset<ErrorStatus>>("Status::ErrorStatus", pos),
6008 _ => Ok(()),
6009 }
6010 })?
6011 .finish();
6012 Ok(())
6013 }
6014}
6015pub struct MessageArgs {
6016 pub data_type: Payload,
6017 pub data: Option<flatbuffers::WIPOffset<flatbuffers::UnionWIPOffset>>,
6018 pub status_type: Status,
6019 pub status: Option<flatbuffers::WIPOffset<flatbuffers::UnionWIPOffset>>,
6020}
6021impl<'a> Default for MessageArgs {
6022 #[inline]
6023 fn default() -> Self {
6024 MessageArgs {
6025 data_type: Payload::NONE,
6026 data: None, status_type: Status::NONE,
6028 status: None, }
6030 }
6031}
6032
6033pub struct MessageBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
6034 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
6035 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
6036}
6037impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> MessageBuilder<'a, 'b, A> {
6038 #[inline]
6039 pub fn add_data_type(&mut self, data_type: Payload) {
6040 self.fbb_.push_slot::<Payload>(Message::VT_DATA_TYPE, data_type, Payload::NONE);
6041 }
6042 #[inline]
6043 pub fn add_data(&mut self, data: flatbuffers::WIPOffset<flatbuffers::UnionWIPOffset>) {
6044 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Message::VT_DATA, data);
6045 }
6046 #[inline]
6047 pub fn add_status_type(&mut self, status_type: Status) {
6048 self.fbb_.push_slot::<Status>(Message::VT_STATUS_TYPE, status_type, Status::NONE);
6049 }
6050 #[inline]
6051 pub fn add_status(&mut self, status: flatbuffers::WIPOffset<flatbuffers::UnionWIPOffset>) {
6052 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Message::VT_STATUS, status);
6053 }
6054 #[inline]
6055 pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> MessageBuilder<'a, 'b, A> {
6056 let start = _fbb.start_table();
6057 MessageBuilder {
6058 fbb_: _fbb,
6059 start_: start,
6060 }
6061 }
6062 #[inline]
6063 pub fn finish(self) -> flatbuffers::WIPOffset<Message<'a>> {
6064 let o = self.fbb_.end_table(self.start_);
6065 self.fbb_.required(o, Message::VT_DATA,"data");
6066 self.fbb_.required(o, Message::VT_STATUS,"status");
6067 flatbuffers::WIPOffset::new(o.value())
6068 }
6069}
6070
6071impl core::fmt::Debug for Message<'_> {
6072 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
6073 let mut ds = f.debug_struct("Message");
6074 ds.field("data_type", &self.data_type());
6075 match self.data_type() {
6076 Payload::CreatePlanRequest => {
6077 if let Some(x) = self.data_as_create_plan_request() {
6078 ds.field("data", &x)
6079 } else {
6080 ds.field("data", &"InvalidFlatbuffer: Union discriminant does not match value.")
6081 }
6082 },
6083 Payload::CreatePlanResponse => {
6084 if let Some(x) = self.data_as_create_plan_response() {
6085 ds.field("data", &x)
6086 } else {
6087 ds.field("data", &"InvalidFlatbuffer: Union discriminant does not match value.")
6088 }
6089 },
6090 Payload::GetPlanRequest => {
6091 if let Some(x) = self.data_as_get_plan_request() {
6092 ds.field("data", &x)
6093 } else {
6094 ds.field("data", &"InvalidFlatbuffer: Union discriminant does not match value.")
6095 }
6096 },
6097 Payload::GetPlansRequest => {
6098 if let Some(x) = self.data_as_get_plans_request() {
6099 ds.field("data", &x)
6100 } else {
6101 ds.field("data", &"InvalidFlatbuffer: Union discriminant does not match value.")
6102 }
6103 },
6104 Payload::Train => {
6105 if let Some(x) = self.data_as_train() {
6106 ds.field("data", &x)
6107 } else {
6108 ds.field("data", &"InvalidFlatbuffer: Union discriminant does not match value.")
6109 }
6110 },
6111 Payload::Catalog => {
6112 if let Some(x) = self.data_as_catalog() {
6113 ds.field("data", &x)
6114 } else {
6115 ds.field("data", &"InvalidFlatbuffer: Union discriminant does not match value.")
6116 }
6117 },
6118 Payload::RegisterRequest => {
6119 if let Some(x) = self.data_as_register_request() {
6120 ds.field("data", &x)
6121 } else {
6122 ds.field("data", &"InvalidFlatbuffer: Union discriminant does not match value.")
6123 }
6124 },
6125 Payload::RegisterResponse => {
6126 if let Some(x) = self.data_as_register_response() {
6127 ds.field("data", &x)
6128 } else {
6129 ds.field("data", &"InvalidFlatbuffer: Union discriminant does not match value.")
6130 }
6131 },
6132 Payload::BindRequest => {
6133 if let Some(x) = self.data_as_bind_request() {
6134 ds.field("data", &x)
6135 } else {
6136 ds.field("data", &"InvalidFlatbuffer: Union discriminant does not match value.")
6137 }
6138 },
6139 Payload::BindResponse => {
6140 if let Some(x) = self.data_as_bind_response() {
6141 ds.field("data", &x)
6142 } else {
6143 ds.field("data", &"InvalidFlatbuffer: Union discriminant does not match value.")
6144 }
6145 },
6146 Payload::UnbindRequest => {
6147 if let Some(x) = self.data_as_unbind_request() {
6148 ds.field("data", &x)
6149 } else {
6150 ds.field("data", &"InvalidFlatbuffer: Union discriminant does not match value.")
6151 }
6152 },
6153 Payload::UnbindResponse => {
6154 if let Some(x) = self.data_as_unbind_response() {
6155 ds.field("data", &x)
6156 } else {
6157 ds.field("data", &"InvalidFlatbuffer: Union discriminant does not match value.")
6158 }
6159 },
6160 Payload::Disconnect => {
6161 if let Some(x) = self.data_as_disconnect() {
6162 ds.field("data", &x)
6163 } else {
6164 ds.field("data", &"InvalidFlatbuffer: Union discriminant does not match value.")
6165 }
6166 },
6167 _ => {
6168 let x: Option<()> = None;
6169 ds.field("data", &x)
6170 },
6171 };
6172 ds.field("status_type", &self.status_type());
6173 match self.status_type() {
6174 Status::OkStatus => {
6175 if let Some(x) = self.status_as_ok_status() {
6176 ds.field("status", &x)
6177 } else {
6178 ds.field("status", &"InvalidFlatbuffer: Union discriminant does not match value.")
6179 }
6180 },
6181 Status::ErrorStatus => {
6182 if let Some(x) = self.status_as_error_status() {
6183 ds.field("status", &x)
6184 } else {
6185 ds.field("status", &"InvalidFlatbuffer: Union discriminant does not match value.")
6186 }
6187 },
6188 _ => {
6189 let x: Option<()> = None;
6190 ds.field("status", &x)
6191 },
6192 };
6193 ds.finish()
6194 }
6195}
6196#[inline]
6197pub fn root_as_message(buf: &[u8]) -> Result<Message, flatbuffers::InvalidFlatbuffer> {
6204 flatbuffers::root::<Message>(buf)
6205}
6206#[inline]
6207pub fn size_prefixed_root_as_message(buf: &[u8]) -> Result<Message, flatbuffers::InvalidFlatbuffer> {
6214 flatbuffers::size_prefixed_root::<Message>(buf)
6215}
6216#[inline]
6217pub fn root_as_message_with_opts<'b, 'o>(
6224 opts: &'o flatbuffers::VerifierOptions,
6225 buf: &'b [u8],
6226) -> Result<Message<'b>, flatbuffers::InvalidFlatbuffer> {
6227 flatbuffers::root_with_opts::<Message<'b>>(opts, buf)
6228}
6229#[inline]
6230pub fn size_prefixed_root_as_message_with_opts<'b, 'o>(
6237 opts: &'o flatbuffers::VerifierOptions,
6238 buf: &'b [u8],
6239) -> Result<Message<'b>, flatbuffers::InvalidFlatbuffer> {
6240 flatbuffers::size_prefixed_root_with_opts::<Message<'b>>(opts, buf)
6241}
6242#[inline]
6243pub unsafe fn root_as_message_unchecked(buf: &[u8]) -> Message {
6247 flatbuffers::root_unchecked::<Message>(buf)
6248}
6249#[inline]
6250pub unsafe fn size_prefixed_root_as_message_unchecked(buf: &[u8]) -> Message {
6254 flatbuffers::size_prefixed_root_unchecked::<Message>(buf)
6255}
6256#[inline]
6257pub fn finish_message_buffer<'a, 'b, A: flatbuffers::Allocator + 'a>(
6258 fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
6259 root: flatbuffers::WIPOffset<Message<'a>>) {
6260 fbb.finish(root, None);
6261}
6262
6263#[inline]
6264pub fn finish_size_prefixed_message_buffer<'a, 'b, A: flatbuffers::Allocator + 'a>(fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>, root: flatbuffers::WIPOffset<Message<'a>>) {
6265 fbb.finish_size_prefixed(root, None);
6266}
6267}