flatbuffers_reflection/
reflection_generated.rs

1// automatically generated by the FlatBuffers compiler, do not modify
2
3
4// @generated
5
6use core::mem;
7use core::cmp::Ordering;
8
9extern crate flatbuffers;
10use self::flatbuffers::{EndianScalar, Follow};
11
12#[allow(unused_imports, dead_code)]
13pub mod reflection {
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_BASE_TYPE: i8 = 0;
23#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
24pub const ENUM_MAX_BASE_TYPE: i8 = 19;
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_BASE_TYPE: [BaseType; 20] = [
28  BaseType::None,
29  BaseType::UType,
30  BaseType::Bool,
31  BaseType::Byte,
32  BaseType::UByte,
33  BaseType::Short,
34  BaseType::UShort,
35  BaseType::Int,
36  BaseType::UInt,
37  BaseType::Long,
38  BaseType::ULong,
39  BaseType::Float,
40  BaseType::Double,
41  BaseType::String,
42  BaseType::Vector,
43  BaseType::Obj,
44  BaseType::Union,
45  BaseType::Array,
46  BaseType::Vector64,
47  BaseType::MaxBaseType,
48];
49
50#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
51#[repr(transparent)]
52pub struct BaseType(pub i8);
53#[allow(non_upper_case_globals)]
54impl BaseType {
55  pub const None: Self = Self(0);
56  pub const UType: Self = Self(1);
57  pub const Bool: Self = Self(2);
58  pub const Byte: Self = Self(3);
59  pub const UByte: Self = Self(4);
60  pub const Short: Self = Self(5);
61  pub const UShort: Self = Self(6);
62  pub const Int: Self = Self(7);
63  pub const UInt: Self = Self(8);
64  pub const Long: Self = Self(9);
65  pub const ULong: Self = Self(10);
66  pub const Float: Self = Self(11);
67  pub const Double: Self = Self(12);
68  pub const String: Self = Self(13);
69  pub const Vector: Self = Self(14);
70  pub const Obj: Self = Self(15);
71  pub const Union: Self = Self(16);
72  pub const Array: Self = Self(17);
73  pub const Vector64: Self = Self(18);
74  pub const MaxBaseType: Self = Self(19);
75
76  pub const ENUM_MIN: i8 = 0;
77  pub const ENUM_MAX: i8 = 19;
78  pub const ENUM_VALUES: &'static [Self] = &[
79    Self::None,
80    Self::UType,
81    Self::Bool,
82    Self::Byte,
83    Self::UByte,
84    Self::Short,
85    Self::UShort,
86    Self::Int,
87    Self::UInt,
88    Self::Long,
89    Self::ULong,
90    Self::Float,
91    Self::Double,
92    Self::String,
93    Self::Vector,
94    Self::Obj,
95    Self::Union,
96    Self::Array,
97    Self::Vector64,
98    Self::MaxBaseType,
99  ];
100  /// Returns the variant's name or "" if unknown.
101  pub fn variant_name(self) -> Option<&'static str> {
102    match self {
103      Self::None => Some("None"),
104      Self::UType => Some("UType"),
105      Self::Bool => Some("Bool"),
106      Self::Byte => Some("Byte"),
107      Self::UByte => Some("UByte"),
108      Self::Short => Some("Short"),
109      Self::UShort => Some("UShort"),
110      Self::Int => Some("Int"),
111      Self::UInt => Some("UInt"),
112      Self::Long => Some("Long"),
113      Self::ULong => Some("ULong"),
114      Self::Float => Some("Float"),
115      Self::Double => Some("Double"),
116      Self::String => Some("String"),
117      Self::Vector => Some("Vector"),
118      Self::Obj => Some("Obj"),
119      Self::Union => Some("Union"),
120      Self::Array => Some("Array"),
121      Self::Vector64 => Some("Vector64"),
122      Self::MaxBaseType => Some("MaxBaseType"),
123      _ => None,
124    }
125  }
126}
127impl core::fmt::Debug for BaseType {
128  fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
129    if let Some(name) = self.variant_name() {
130      f.write_str(name)
131    } else {
132      f.write_fmt(format_args!("<UNKNOWN {:?}>", self.0))
133    }
134  }
135}
136impl<'a> flatbuffers::Follow<'a> for BaseType {
137  type Inner = Self;
138  #[inline]
139  unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
140    let b = flatbuffers::read_scalar_at::<i8>(buf, loc);
141    Self(b)
142  }
143}
144
145impl flatbuffers::Push for BaseType {
146    type Output = BaseType;
147    #[inline]
148    unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
149        flatbuffers::emplace_scalar::<i8>(dst, self.0);
150    }
151}
152
153impl flatbuffers::EndianScalar for BaseType {
154  type Scalar = i8;
155  #[inline]
156  fn to_little_endian(self) -> i8 {
157    self.0.to_le()
158  }
159  #[inline]
160  #[allow(clippy::wrong_self_convention)]
161  fn from_little_endian(v: i8) -> Self {
162    let b = i8::from_le(v);
163    Self(b)
164  }
165}
166
167impl<'a> flatbuffers::Verifiable for BaseType {
168  #[inline]
169  fn run_verifier(
170    v: &mut flatbuffers::Verifier, pos: usize
171  ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
172    use self::flatbuffers::Verifiable;
173    i8::run_verifier(v, pos)
174  }
175}
176
177impl flatbuffers::SimpleToVerifyInSlice for BaseType {}
178#[allow(non_upper_case_globals)]
179mod bitflags_advanced_features {
180  flatbuffers::bitflags::bitflags! {
181    /// New schema language features that are not supported by old code generators.
182    #[derive(Default, Debug, Clone, Copy, PartialEq)]
183    pub struct AdvancedFeatures: u64 {
184      const AdvancedArrayFeatures = 1;
185      const AdvancedUnionFeatures = 2;
186      const OptionalScalars = 4;
187      const DefaultVectorsAndStrings = 8;
188    }
189  }
190}
191pub use self::bitflags_advanced_features::AdvancedFeatures;
192
193impl<'a> flatbuffers::Follow<'a> for AdvancedFeatures {
194  type Inner = Self;
195  #[inline]
196  unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
197    let b = flatbuffers::read_scalar_at::<u64>(buf, loc);
198    Self::from_bits_retain(b)
199  }
200}
201
202impl flatbuffers::Push for AdvancedFeatures {
203    type Output = AdvancedFeatures;
204    #[inline]
205    unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
206        flatbuffers::emplace_scalar::<u64>(dst, self.bits());
207    }
208}
209
210impl flatbuffers::EndianScalar for AdvancedFeatures {
211  type Scalar = u64;
212  #[inline]
213  fn to_little_endian(self) -> u64 {
214    self.bits().to_le()
215  }
216  #[inline]
217  #[allow(clippy::wrong_self_convention)]
218  fn from_little_endian(v: u64) -> Self {
219    let b = u64::from_le(v);
220    Self::from_bits_retain(b)
221  }
222}
223
224impl<'a> flatbuffers::Verifiable for AdvancedFeatures {
225  #[inline]
226  fn run_verifier(
227    v: &mut flatbuffers::Verifier, pos: usize
228  ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
229    use self::flatbuffers::Verifiable;
230    u64::run_verifier(v, pos)
231  }
232}
233
234impl flatbuffers::SimpleToVerifyInSlice for AdvancedFeatures {}
235pub enum TypeOffset {}
236#[derive(Copy, Clone, PartialEq)]
237
238pub struct Type<'a> {
239  pub _tab: flatbuffers::Table<'a>,
240}
241
242impl<'a> flatbuffers::Follow<'a> for Type<'a> {
243  type Inner = Type<'a>;
244  #[inline]
245  unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
246    Self { _tab: flatbuffers::Table::new(buf, loc) }
247  }
248}
249
250impl<'a> Type<'a> {
251  pub const VT_BASE_TYPE: flatbuffers::VOffsetT = 4;
252  pub const VT_ELEMENT: flatbuffers::VOffsetT = 6;
253  pub const VT_INDEX: flatbuffers::VOffsetT = 8;
254  pub const VT_FIXED_LENGTH: flatbuffers::VOffsetT = 10;
255  pub const VT_BASE_SIZE: flatbuffers::VOffsetT = 12;
256  pub const VT_ELEMENT_SIZE: flatbuffers::VOffsetT = 14;
257
258  #[inline]
259  pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
260    Type { _tab: table }
261  }
262  #[allow(unused_mut)]
263  pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
264    _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
265    args: &'args TypeArgs
266  ) -> flatbuffers::WIPOffset<Type<'bldr>> {
267    let mut builder = TypeBuilder::new(_fbb);
268    builder.add_element_size(args.element_size);
269    builder.add_base_size(args.base_size);
270    builder.add_index(args.index);
271    builder.add_fixed_length(args.fixed_length);
272    builder.add_element(args.element);
273    builder.add_base_type(args.base_type);
274    builder.finish()
275  }
276
277
278  #[inline]
279  pub fn base_type(&self) -> BaseType {
280    // Safety:
281    // Created from valid Table for this object
282    // which contains a valid value in this slot
283    unsafe { self._tab.get::<BaseType>(Type::VT_BASE_TYPE, Some(BaseType::None)).unwrap()}
284  }
285  #[inline]
286  pub fn element(&self) -> BaseType {
287    // Safety:
288    // Created from valid Table for this object
289    // which contains a valid value in this slot
290    unsafe { self._tab.get::<BaseType>(Type::VT_ELEMENT, Some(BaseType::None)).unwrap()}
291  }
292  #[inline]
293  pub fn index(&self) -> i32 {
294    // Safety:
295    // Created from valid Table for this object
296    // which contains a valid value in this slot
297    unsafe { self._tab.get::<i32>(Type::VT_INDEX, Some(-1)).unwrap()}
298  }
299  #[inline]
300  pub fn fixed_length(&self) -> u16 {
301    // Safety:
302    // Created from valid Table for this object
303    // which contains a valid value in this slot
304    unsafe { self._tab.get::<u16>(Type::VT_FIXED_LENGTH, Some(0)).unwrap()}
305  }
306  /// The size (octets) of the `base_type` field.
307  #[inline]
308  pub fn base_size(&self) -> u32 {
309    // Safety:
310    // Created from valid Table for this object
311    // which contains a valid value in this slot
312    unsafe { self._tab.get::<u32>(Type::VT_BASE_SIZE, Some(4)).unwrap()}
313  }
314  /// The size (octets) of the `element` field, if present.
315  #[inline]
316  pub fn element_size(&self) -> u32 {
317    // Safety:
318    // Created from valid Table for this object
319    // which contains a valid value in this slot
320    unsafe { self._tab.get::<u32>(Type::VT_ELEMENT_SIZE, Some(0)).unwrap()}
321  }
322}
323
324impl flatbuffers::Verifiable for Type<'_> {
325  #[inline]
326  fn run_verifier(
327    v: &mut flatbuffers::Verifier, pos: usize
328  ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
329    use self::flatbuffers::Verifiable;
330    v.visit_table(pos)?
331     .visit_field::<BaseType>("base_type", Self::VT_BASE_TYPE, false)?
332     .visit_field::<BaseType>("element", Self::VT_ELEMENT, false)?
333     .visit_field::<i32>("index", Self::VT_INDEX, false)?
334     .visit_field::<u16>("fixed_length", Self::VT_FIXED_LENGTH, false)?
335     .visit_field::<u32>("base_size", Self::VT_BASE_SIZE, false)?
336     .visit_field::<u32>("element_size", Self::VT_ELEMENT_SIZE, false)?
337     .finish();
338    Ok(())
339  }
340}
341pub struct TypeArgs {
342    pub base_type: BaseType,
343    pub element: BaseType,
344    pub index: i32,
345    pub fixed_length: u16,
346    pub base_size: u32,
347    pub element_size: u32,
348}
349impl<'a> Default for TypeArgs {
350  #[inline]
351  fn default() -> Self {
352    TypeArgs {
353      base_type: BaseType::None,
354      element: BaseType::None,
355      index: -1,
356      fixed_length: 0,
357      base_size: 4,
358      element_size: 0,
359    }
360  }
361}
362
363pub struct TypeBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
364  fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
365  start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
366}
367impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> TypeBuilder<'a, 'b, A> {
368  #[inline]
369  pub fn add_base_type(&mut self, base_type: BaseType) {
370    self.fbb_.push_slot::<BaseType>(Type::VT_BASE_TYPE, base_type, BaseType::None);
371  }
372  #[inline]
373  pub fn add_element(&mut self, element: BaseType) {
374    self.fbb_.push_slot::<BaseType>(Type::VT_ELEMENT, element, BaseType::None);
375  }
376  #[inline]
377  pub fn add_index(&mut self, index: i32) {
378    self.fbb_.push_slot::<i32>(Type::VT_INDEX, index, -1);
379  }
380  #[inline]
381  pub fn add_fixed_length(&mut self, fixed_length: u16) {
382    self.fbb_.push_slot::<u16>(Type::VT_FIXED_LENGTH, fixed_length, 0);
383  }
384  #[inline]
385  pub fn add_base_size(&mut self, base_size: u32) {
386    self.fbb_.push_slot::<u32>(Type::VT_BASE_SIZE, base_size, 4);
387  }
388  #[inline]
389  pub fn add_element_size(&mut self, element_size: u32) {
390    self.fbb_.push_slot::<u32>(Type::VT_ELEMENT_SIZE, element_size, 0);
391  }
392  #[inline]
393  pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> TypeBuilder<'a, 'b, A> {
394    let start = _fbb.start_table();
395    TypeBuilder {
396      fbb_: _fbb,
397      start_: start,
398    }
399  }
400  #[inline]
401  pub fn finish(self) -> flatbuffers::WIPOffset<Type<'a>> {
402    let o = self.fbb_.end_table(self.start_);
403    flatbuffers::WIPOffset::new(o.value())
404  }
405}
406
407impl core::fmt::Debug for Type<'_> {
408  fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
409    let mut ds = f.debug_struct("Type");
410      ds.field("base_type", &self.base_type());
411      ds.field("element", &self.element());
412      ds.field("index", &self.index());
413      ds.field("fixed_length", &self.fixed_length());
414      ds.field("base_size", &self.base_size());
415      ds.field("element_size", &self.element_size());
416      ds.finish()
417  }
418}
419pub enum KeyValueOffset {}
420#[derive(Copy, Clone, PartialEq)]
421
422pub struct KeyValue<'a> {
423  pub _tab: flatbuffers::Table<'a>,
424}
425
426impl<'a> flatbuffers::Follow<'a> for KeyValue<'a> {
427  type Inner = KeyValue<'a>;
428  #[inline]
429  unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
430    Self { _tab: flatbuffers::Table::new(buf, loc) }
431  }
432}
433
434impl<'a> KeyValue<'a> {
435  pub const VT_KEY: flatbuffers::VOffsetT = 4;
436  pub const VT_VALUE: flatbuffers::VOffsetT = 6;
437
438  #[inline]
439  pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
440    KeyValue { _tab: table }
441  }
442  #[allow(unused_mut)]
443  pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
444    _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
445    args: &'args KeyValueArgs<'args>
446  ) -> flatbuffers::WIPOffset<KeyValue<'bldr>> {
447    let mut builder = KeyValueBuilder::new(_fbb);
448    if let Some(x) = args.value { builder.add_value(x); }
449    if let Some(x) = args.key { builder.add_key(x); }
450    builder.finish()
451  }
452
453
454  #[inline]
455  pub fn key(&self) -> &'a str {
456    // Safety:
457    // Created from valid Table for this object
458    // which contains a valid value in this slot
459    unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<&str>>(KeyValue::VT_KEY, None).unwrap()}
460  }
461  #[inline]
462  pub fn key_compare_less_than(&self, o: &KeyValue) -> bool {
463    self.key() < o.key()
464  }
465
466  #[inline]
467  pub fn key_compare_with_value(&self, val: & str) -> ::core::cmp::Ordering {
468    let key = self.key();
469    key.cmp(val)
470  }
471  #[inline]
472  pub fn value(&self) -> Option<&'a str> {
473    // Safety:
474    // Created from valid Table for this object
475    // which contains a valid value in this slot
476    unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<&str>>(KeyValue::VT_VALUE, None)}
477  }
478}
479
480impl flatbuffers::Verifiable for KeyValue<'_> {
481  #[inline]
482  fn run_verifier(
483    v: &mut flatbuffers::Verifier, pos: usize
484  ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
485    use self::flatbuffers::Verifiable;
486    v.visit_table(pos)?
487     .visit_field::<flatbuffers::ForwardsUOffset<&str>>("key", Self::VT_KEY, true)?
488     .visit_field::<flatbuffers::ForwardsUOffset<&str>>("value", Self::VT_VALUE, false)?
489     .finish();
490    Ok(())
491  }
492}
493pub struct KeyValueArgs<'a> {
494    pub key: Option<flatbuffers::WIPOffset<&'a str>>,
495    pub value: Option<flatbuffers::WIPOffset<&'a str>>,
496}
497impl<'a> Default for KeyValueArgs<'a> {
498  #[inline]
499  fn default() -> Self {
500    KeyValueArgs {
501      key: None, // required field
502      value: None,
503    }
504  }
505}
506
507pub struct KeyValueBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
508  fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
509  start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
510}
511impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> KeyValueBuilder<'a, 'b, A> {
512  #[inline]
513  pub fn add_key(&mut self, key: flatbuffers::WIPOffset<&'b  str>) {
514    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(KeyValue::VT_KEY, key);
515  }
516  #[inline]
517  pub fn add_value(&mut self, value: flatbuffers::WIPOffset<&'b  str>) {
518    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(KeyValue::VT_VALUE, value);
519  }
520  #[inline]
521  pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> KeyValueBuilder<'a, 'b, A> {
522    let start = _fbb.start_table();
523    KeyValueBuilder {
524      fbb_: _fbb,
525      start_: start,
526    }
527  }
528  #[inline]
529  pub fn finish(self) -> flatbuffers::WIPOffset<KeyValue<'a>> {
530    let o = self.fbb_.end_table(self.start_);
531    self.fbb_.required(o, KeyValue::VT_KEY,"key");
532    flatbuffers::WIPOffset::new(o.value())
533  }
534}
535
536impl core::fmt::Debug for KeyValue<'_> {
537  fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
538    let mut ds = f.debug_struct("KeyValue");
539      ds.field("key", &self.key());
540      ds.field("value", &self.value());
541      ds.finish()
542  }
543}
544pub enum EnumValOffset {}
545#[derive(Copy, Clone, PartialEq)]
546
547pub struct EnumVal<'a> {
548  pub _tab: flatbuffers::Table<'a>,
549}
550
551impl<'a> flatbuffers::Follow<'a> for EnumVal<'a> {
552  type Inner = EnumVal<'a>;
553  #[inline]
554  unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
555    Self { _tab: flatbuffers::Table::new(buf, loc) }
556  }
557}
558
559impl<'a> EnumVal<'a> {
560  pub const VT_NAME: flatbuffers::VOffsetT = 4;
561  pub const VT_VALUE: flatbuffers::VOffsetT = 6;
562  pub const VT_UNION_TYPE: flatbuffers::VOffsetT = 10;
563  pub const VT_DOCUMENTATION: flatbuffers::VOffsetT = 12;
564  pub const VT_ATTRIBUTES: flatbuffers::VOffsetT = 14;
565
566  #[inline]
567  pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
568    EnumVal { _tab: table }
569  }
570  #[allow(unused_mut)]
571  pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
572    _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
573    args: &'args EnumValArgs<'args>
574  ) -> flatbuffers::WIPOffset<EnumVal<'bldr>> {
575    let mut builder = EnumValBuilder::new(_fbb);
576    builder.add_value(args.value);
577    if let Some(x) = args.attributes { builder.add_attributes(x); }
578    if let Some(x) = args.documentation { builder.add_documentation(x); }
579    if let Some(x) = args.union_type { builder.add_union_type(x); }
580    if let Some(x) = args.name { builder.add_name(x); }
581    builder.finish()
582  }
583
584
585  #[inline]
586  pub fn name(&self) -> &'a str {
587    // Safety:
588    // Created from valid Table for this object
589    // which contains a valid value in this slot
590    unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<&str>>(EnumVal::VT_NAME, None).unwrap()}
591  }
592  #[inline]
593  pub fn value(&self) -> i64 {
594    // Safety:
595    // Created from valid Table for this object
596    // which contains a valid value in this slot
597    unsafe { self._tab.get::<i64>(EnumVal::VT_VALUE, Some(0)).unwrap()}
598  }
599  #[inline]
600  pub fn key_compare_less_than(&self, o: &EnumVal) -> bool {
601    self.value() < o.value()
602  }
603
604  #[inline]
605  pub fn key_compare_with_value(&self, val: i64) -> ::core::cmp::Ordering {
606    let key = self.value();
607    key.cmp(&val)
608  }
609  #[inline]
610  pub fn union_type(&self) -> Option<Type<'a>> {
611    // Safety:
612    // Created from valid Table for this object
613    // which contains a valid value in this slot
614    unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<Type>>(EnumVal::VT_UNION_TYPE, None)}
615  }
616  #[inline]
617  pub fn documentation(&self) -> Option<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<&'a str>>> {
618    // Safety:
619    // Created from valid Table for this object
620    // which contains a valid value in this slot
621    unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<&'a str>>>>(EnumVal::VT_DOCUMENTATION, None)}
622  }
623  #[inline]
624  pub fn attributes(&self) -> Option<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<KeyValue<'a>>>> {
625    // Safety:
626    // Created from valid Table for this object
627    // which contains a valid value in this slot
628    unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<KeyValue>>>>(EnumVal::VT_ATTRIBUTES, None)}
629  }
630}
631
632impl flatbuffers::Verifiable for EnumVal<'_> {
633  #[inline]
634  fn run_verifier(
635    v: &mut flatbuffers::Verifier, pos: usize
636  ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
637    use self::flatbuffers::Verifiable;
638    v.visit_table(pos)?
639     .visit_field::<flatbuffers::ForwardsUOffset<&str>>("name", Self::VT_NAME, true)?
640     .visit_field::<i64>("value", Self::VT_VALUE, false)?
641     .visit_field::<flatbuffers::ForwardsUOffset<Type>>("union_type", Self::VT_UNION_TYPE, false)?
642     .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, flatbuffers::ForwardsUOffset<&'_ str>>>>("documentation", Self::VT_DOCUMENTATION, false)?
643     .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, flatbuffers::ForwardsUOffset<KeyValue>>>>("attributes", Self::VT_ATTRIBUTES, false)?
644     .finish();
645    Ok(())
646  }
647}
648pub struct EnumValArgs<'a> {
649    pub name: Option<flatbuffers::WIPOffset<&'a str>>,
650    pub value: i64,
651    pub union_type: Option<flatbuffers::WIPOffset<Type<'a>>>,
652    pub documentation: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<&'a str>>>>,
653    pub attributes: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<KeyValue<'a>>>>>,
654}
655impl<'a> Default for EnumValArgs<'a> {
656  #[inline]
657  fn default() -> Self {
658    EnumValArgs {
659      name: None, // required field
660      value: 0,
661      union_type: None,
662      documentation: None,
663      attributes: None,
664    }
665  }
666}
667
668pub struct EnumValBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
669  fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
670  start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
671}
672impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> EnumValBuilder<'a, 'b, A> {
673  #[inline]
674  pub fn add_name(&mut self, name: flatbuffers::WIPOffset<&'b  str>) {
675    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(EnumVal::VT_NAME, name);
676  }
677  #[inline]
678  pub fn add_value(&mut self, value: i64) {
679    self.fbb_.push_slot::<i64>(EnumVal::VT_VALUE, value, 0);
680  }
681  #[inline]
682  pub fn add_union_type(&mut self, union_type: flatbuffers::WIPOffset<Type<'b >>) {
683    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<Type>>(EnumVal::VT_UNION_TYPE, union_type);
684  }
685  #[inline]
686  pub fn add_documentation(&mut self, documentation: flatbuffers::WIPOffset<flatbuffers::Vector<'b , flatbuffers::ForwardsUOffset<&'b  str>>>) {
687    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(EnumVal::VT_DOCUMENTATION, documentation);
688  }
689  #[inline]
690  pub fn add_attributes(&mut self, attributes: flatbuffers::WIPOffset<flatbuffers::Vector<'b , flatbuffers::ForwardsUOffset<KeyValue<'b >>>>) {
691    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(EnumVal::VT_ATTRIBUTES, attributes);
692  }
693  #[inline]
694  pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> EnumValBuilder<'a, 'b, A> {
695    let start = _fbb.start_table();
696    EnumValBuilder {
697      fbb_: _fbb,
698      start_: start,
699    }
700  }
701  #[inline]
702  pub fn finish(self) -> flatbuffers::WIPOffset<EnumVal<'a>> {
703    let o = self.fbb_.end_table(self.start_);
704    self.fbb_.required(o, EnumVal::VT_NAME,"name");
705    flatbuffers::WIPOffset::new(o.value())
706  }
707}
708
709impl core::fmt::Debug for EnumVal<'_> {
710  fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
711    let mut ds = f.debug_struct("EnumVal");
712      ds.field("name", &self.name());
713      ds.field("value", &self.value());
714      ds.field("union_type", &self.union_type());
715      ds.field("documentation", &self.documentation());
716      ds.field("attributes", &self.attributes());
717      ds.finish()
718  }
719}
720pub enum EnumOffset {}
721#[derive(Copy, Clone, PartialEq)]
722
723pub struct Enum<'a> {
724  pub _tab: flatbuffers::Table<'a>,
725}
726
727impl<'a> flatbuffers::Follow<'a> for Enum<'a> {
728  type Inner = Enum<'a>;
729  #[inline]
730  unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
731    Self { _tab: flatbuffers::Table::new(buf, loc) }
732  }
733}
734
735impl<'a> Enum<'a> {
736  pub const VT_NAME: flatbuffers::VOffsetT = 4;
737  pub const VT_VALUES: flatbuffers::VOffsetT = 6;
738  pub const VT_IS_UNION: flatbuffers::VOffsetT = 8;
739  pub const VT_UNDERLYING_TYPE: flatbuffers::VOffsetT = 10;
740  pub const VT_ATTRIBUTES: flatbuffers::VOffsetT = 12;
741  pub const VT_DOCUMENTATION: flatbuffers::VOffsetT = 14;
742  pub const VT_DECLARATION_FILE: flatbuffers::VOffsetT = 16;
743
744  #[inline]
745  pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
746    Enum { _tab: table }
747  }
748  #[allow(unused_mut)]
749  pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
750    _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
751    args: &'args EnumArgs<'args>
752  ) -> flatbuffers::WIPOffset<Enum<'bldr>> {
753    let mut builder = EnumBuilder::new(_fbb);
754    if let Some(x) = args.declaration_file { builder.add_declaration_file(x); }
755    if let Some(x) = args.documentation { builder.add_documentation(x); }
756    if let Some(x) = args.attributes { builder.add_attributes(x); }
757    if let Some(x) = args.underlying_type { builder.add_underlying_type(x); }
758    if let Some(x) = args.values { builder.add_values(x); }
759    if let Some(x) = args.name { builder.add_name(x); }
760    builder.add_is_union(args.is_union);
761    builder.finish()
762  }
763
764
765  #[inline]
766  pub fn name(&self) -> &'a str {
767    // Safety:
768    // Created from valid Table for this object
769    // which contains a valid value in this slot
770    unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<&str>>(Enum::VT_NAME, None).unwrap()}
771  }
772  #[inline]
773  pub fn key_compare_less_than(&self, o: &Enum) -> bool {
774    self.name() < o.name()
775  }
776
777  #[inline]
778  pub fn key_compare_with_value(&self, val: & str) -> ::core::cmp::Ordering {
779    let key = self.name();
780    key.cmp(val)
781  }
782  #[inline]
783  pub fn values(&self) -> flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<EnumVal<'a>>> {
784    // Safety:
785    // Created from valid Table for this object
786    // which contains a valid value in this slot
787    unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<EnumVal>>>>(Enum::VT_VALUES, None).unwrap()}
788  }
789  #[inline]
790  pub fn is_union(&self) -> bool {
791    // Safety:
792    // Created from valid Table for this object
793    // which contains a valid value in this slot
794    unsafe { self._tab.get::<bool>(Enum::VT_IS_UNION, Some(false)).unwrap()}
795  }
796  #[inline]
797  pub fn underlying_type(&self) -> Type<'a> {
798    // Safety:
799    // Created from valid Table for this object
800    // which contains a valid value in this slot
801    unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<Type>>(Enum::VT_UNDERLYING_TYPE, None).unwrap()}
802  }
803  #[inline]
804  pub fn attributes(&self) -> Option<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<KeyValue<'a>>>> {
805    // Safety:
806    // Created from valid Table for this object
807    // which contains a valid value in this slot
808    unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<KeyValue>>>>(Enum::VT_ATTRIBUTES, None)}
809  }
810  #[inline]
811  pub fn documentation(&self) -> Option<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<&'a str>>> {
812    // Safety:
813    // Created from valid Table for this object
814    // which contains a valid value in this slot
815    unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<&'a str>>>>(Enum::VT_DOCUMENTATION, None)}
816  }
817  /// File that this Enum is declared in.
818  #[inline]
819  pub fn declaration_file(&self) -> Option<&'a str> {
820    // Safety:
821    // Created from valid Table for this object
822    // which contains a valid value in this slot
823    unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<&str>>(Enum::VT_DECLARATION_FILE, None)}
824  }
825}
826
827impl flatbuffers::Verifiable for Enum<'_> {
828  #[inline]
829  fn run_verifier(
830    v: &mut flatbuffers::Verifier, pos: usize
831  ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
832    use self::flatbuffers::Verifiable;
833    v.visit_table(pos)?
834     .visit_field::<flatbuffers::ForwardsUOffset<&str>>("name", Self::VT_NAME, true)?
835     .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, flatbuffers::ForwardsUOffset<EnumVal>>>>("values", Self::VT_VALUES, true)?
836     .visit_field::<bool>("is_union", Self::VT_IS_UNION, false)?
837     .visit_field::<flatbuffers::ForwardsUOffset<Type>>("underlying_type", Self::VT_UNDERLYING_TYPE, true)?
838     .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, flatbuffers::ForwardsUOffset<KeyValue>>>>("attributes", Self::VT_ATTRIBUTES, false)?
839     .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, flatbuffers::ForwardsUOffset<&'_ str>>>>("documentation", Self::VT_DOCUMENTATION, false)?
840     .visit_field::<flatbuffers::ForwardsUOffset<&str>>("declaration_file", Self::VT_DECLARATION_FILE, false)?
841     .finish();
842    Ok(())
843  }
844}
845pub struct EnumArgs<'a> {
846    pub name: Option<flatbuffers::WIPOffset<&'a str>>,
847    pub values: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<EnumVal<'a>>>>>,
848    pub is_union: bool,
849    pub underlying_type: Option<flatbuffers::WIPOffset<Type<'a>>>,
850    pub attributes: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<KeyValue<'a>>>>>,
851    pub documentation: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<&'a str>>>>,
852    pub declaration_file: Option<flatbuffers::WIPOffset<&'a str>>,
853}
854impl<'a> Default for EnumArgs<'a> {
855  #[inline]
856  fn default() -> Self {
857    EnumArgs {
858      name: None, // required field
859      values: None, // required field
860      is_union: false,
861      underlying_type: None, // required field
862      attributes: None,
863      documentation: None,
864      declaration_file: None,
865    }
866  }
867}
868
869pub struct EnumBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
870  fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
871  start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
872}
873impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> EnumBuilder<'a, 'b, A> {
874  #[inline]
875  pub fn add_name(&mut self, name: flatbuffers::WIPOffset<&'b  str>) {
876    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Enum::VT_NAME, name);
877  }
878  #[inline]
879  pub fn add_values(&mut self, values: flatbuffers::WIPOffset<flatbuffers::Vector<'b , flatbuffers::ForwardsUOffset<EnumVal<'b >>>>) {
880    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Enum::VT_VALUES, values);
881  }
882  #[inline]
883  pub fn add_is_union(&mut self, is_union: bool) {
884    self.fbb_.push_slot::<bool>(Enum::VT_IS_UNION, is_union, false);
885  }
886  #[inline]
887  pub fn add_underlying_type(&mut self, underlying_type: flatbuffers::WIPOffset<Type<'b >>) {
888    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<Type>>(Enum::VT_UNDERLYING_TYPE, underlying_type);
889  }
890  #[inline]
891  pub fn add_attributes(&mut self, attributes: flatbuffers::WIPOffset<flatbuffers::Vector<'b , flatbuffers::ForwardsUOffset<KeyValue<'b >>>>) {
892    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Enum::VT_ATTRIBUTES, attributes);
893  }
894  #[inline]
895  pub fn add_documentation(&mut self, documentation: flatbuffers::WIPOffset<flatbuffers::Vector<'b , flatbuffers::ForwardsUOffset<&'b  str>>>) {
896    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Enum::VT_DOCUMENTATION, documentation);
897  }
898  #[inline]
899  pub fn add_declaration_file(&mut self, declaration_file: flatbuffers::WIPOffset<&'b  str>) {
900    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Enum::VT_DECLARATION_FILE, declaration_file);
901  }
902  #[inline]
903  pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> EnumBuilder<'a, 'b, A> {
904    let start = _fbb.start_table();
905    EnumBuilder {
906      fbb_: _fbb,
907      start_: start,
908    }
909  }
910  #[inline]
911  pub fn finish(self) -> flatbuffers::WIPOffset<Enum<'a>> {
912    let o = self.fbb_.end_table(self.start_);
913    self.fbb_.required(o, Enum::VT_NAME,"name");
914    self.fbb_.required(o, Enum::VT_VALUES,"values");
915    self.fbb_.required(o, Enum::VT_UNDERLYING_TYPE,"underlying_type");
916    flatbuffers::WIPOffset::new(o.value())
917  }
918}
919
920impl core::fmt::Debug for Enum<'_> {
921  fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
922    let mut ds = f.debug_struct("Enum");
923      ds.field("name", &self.name());
924      ds.field("values", &self.values());
925      ds.field("is_union", &self.is_union());
926      ds.field("underlying_type", &self.underlying_type());
927      ds.field("attributes", &self.attributes());
928      ds.field("documentation", &self.documentation());
929      ds.field("declaration_file", &self.declaration_file());
930      ds.finish()
931  }
932}
933pub enum FieldOffset {}
934#[derive(Copy, Clone, PartialEq)]
935
936pub struct Field<'a> {
937  pub _tab: flatbuffers::Table<'a>,
938}
939
940impl<'a> flatbuffers::Follow<'a> for Field<'a> {
941  type Inner = Field<'a>;
942  #[inline]
943  unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
944    Self { _tab: flatbuffers::Table::new(buf, loc) }
945  }
946}
947
948impl<'a> Field<'a> {
949  pub const VT_NAME: flatbuffers::VOffsetT = 4;
950  pub const VT_TYPE_: flatbuffers::VOffsetT = 6;
951  pub const VT_ID: flatbuffers::VOffsetT = 8;
952  pub const VT_OFFSET: flatbuffers::VOffsetT = 10;
953  pub const VT_DEFAULT_INTEGER: flatbuffers::VOffsetT = 12;
954  pub const VT_DEFAULT_REAL: flatbuffers::VOffsetT = 14;
955  pub const VT_DEPRECATED: flatbuffers::VOffsetT = 16;
956  pub const VT_REQUIRED: flatbuffers::VOffsetT = 18;
957  pub const VT_KEY: flatbuffers::VOffsetT = 20;
958  pub const VT_ATTRIBUTES: flatbuffers::VOffsetT = 22;
959  pub const VT_DOCUMENTATION: flatbuffers::VOffsetT = 24;
960  pub const VT_OPTIONAL: flatbuffers::VOffsetT = 26;
961  pub const VT_PADDING: flatbuffers::VOffsetT = 28;
962  pub const VT_OFFSET64: flatbuffers::VOffsetT = 30;
963
964  #[inline]
965  pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
966    Field { _tab: table }
967  }
968  #[allow(unused_mut)]
969  pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
970    _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
971    args: &'args FieldArgs<'args>
972  ) -> flatbuffers::WIPOffset<Field<'bldr>> {
973    let mut builder = FieldBuilder::new(_fbb);
974    builder.add_default_real(args.default_real);
975    builder.add_default_integer(args.default_integer);
976    if let Some(x) = args.documentation { builder.add_documentation(x); }
977    if let Some(x) = args.attributes { builder.add_attributes(x); }
978    if let Some(x) = args.type_ { builder.add_type_(x); }
979    if let Some(x) = args.name { builder.add_name(x); }
980    builder.add_padding(args.padding);
981    builder.add_offset(args.offset);
982    builder.add_id(args.id);
983    builder.add_offset64(args.offset64);
984    builder.add_optional(args.optional);
985    builder.add_key(args.key);
986    builder.add_required(args.required);
987    builder.add_deprecated(args.deprecated);
988    builder.finish()
989  }
990
991
992  #[inline]
993  pub fn name(&self) -> &'a str {
994    // Safety:
995    // Created from valid Table for this object
996    // which contains a valid value in this slot
997    unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<&str>>(Field::VT_NAME, None).unwrap()}
998  }
999  #[inline]
1000  pub fn key_compare_less_than(&self, o: &Field) -> bool {
1001    self.name() < o.name()
1002  }
1003
1004  #[inline]
1005  pub fn key_compare_with_value(&self, val: & str) -> ::core::cmp::Ordering {
1006    let key = self.name();
1007    key.cmp(val)
1008  }
1009  #[inline]
1010  pub fn type_(&self) -> Type<'a> {
1011    // Safety:
1012    // Created from valid Table for this object
1013    // which contains a valid value in this slot
1014    unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<Type>>(Field::VT_TYPE_, None).unwrap()}
1015  }
1016  #[inline]
1017  pub fn id(&self) -> u16 {
1018    // Safety:
1019    // Created from valid Table for this object
1020    // which contains a valid value in this slot
1021    unsafe { self._tab.get::<u16>(Field::VT_ID, Some(0)).unwrap()}
1022  }
1023  #[inline]
1024  pub fn offset(&self) -> u16 {
1025    // Safety:
1026    // Created from valid Table for this object
1027    // which contains a valid value in this slot
1028    unsafe { self._tab.get::<u16>(Field::VT_OFFSET, Some(0)).unwrap()}
1029  }
1030  #[inline]
1031  pub fn default_integer(&self) -> i64 {
1032    // Safety:
1033    // Created from valid Table for this object
1034    // which contains a valid value in this slot
1035    unsafe { self._tab.get::<i64>(Field::VT_DEFAULT_INTEGER, Some(0)).unwrap()}
1036  }
1037  #[inline]
1038  pub fn default_real(&self) -> f64 {
1039    // Safety:
1040    // Created from valid Table for this object
1041    // which contains a valid value in this slot
1042    unsafe { self._tab.get::<f64>(Field::VT_DEFAULT_REAL, Some(0.0)).unwrap()}
1043  }
1044  #[inline]
1045  pub fn deprecated(&self) -> bool {
1046    // Safety:
1047    // Created from valid Table for this object
1048    // which contains a valid value in this slot
1049    unsafe { self._tab.get::<bool>(Field::VT_DEPRECATED, Some(false)).unwrap()}
1050  }
1051  #[inline]
1052  pub fn required(&self) -> bool {
1053    // Safety:
1054    // Created from valid Table for this object
1055    // which contains a valid value in this slot
1056    unsafe { self._tab.get::<bool>(Field::VT_REQUIRED, Some(false)).unwrap()}
1057  }
1058  #[inline]
1059  pub fn key(&self) -> bool {
1060    // Safety:
1061    // Created from valid Table for this object
1062    // which contains a valid value in this slot
1063    unsafe { self._tab.get::<bool>(Field::VT_KEY, Some(false)).unwrap()}
1064  }
1065  #[inline]
1066  pub fn attributes(&self) -> Option<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<KeyValue<'a>>>> {
1067    // Safety:
1068    // Created from valid Table for this object
1069    // which contains a valid value in this slot
1070    unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<KeyValue>>>>(Field::VT_ATTRIBUTES, None)}
1071  }
1072  #[inline]
1073  pub fn documentation(&self) -> Option<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<&'a str>>> {
1074    // Safety:
1075    // Created from valid Table for this object
1076    // which contains a valid value in this slot
1077    unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<&'a str>>>>(Field::VT_DOCUMENTATION, None)}
1078  }
1079  #[inline]
1080  pub fn optional(&self) -> bool {
1081    // Safety:
1082    // Created from valid Table for this object
1083    // which contains a valid value in this slot
1084    unsafe { self._tab.get::<bool>(Field::VT_OPTIONAL, Some(false)).unwrap()}
1085  }
1086  /// Number of padding octets to always add after this field. Structs only.
1087  #[inline]
1088  pub fn padding(&self) -> u16 {
1089    // Safety:
1090    // Created from valid Table for this object
1091    // which contains a valid value in this slot
1092    unsafe { self._tab.get::<u16>(Field::VT_PADDING, Some(0)).unwrap()}
1093  }
1094  /// If the field uses 64-bit offsets.
1095  #[inline]
1096  pub fn offset64(&self) -> bool {
1097    // Safety:
1098    // Created from valid Table for this object
1099    // which contains a valid value in this slot
1100    unsafe { self._tab.get::<bool>(Field::VT_OFFSET64, Some(false)).unwrap()}
1101  }
1102}
1103
1104impl flatbuffers::Verifiable for Field<'_> {
1105  #[inline]
1106  fn run_verifier(
1107    v: &mut flatbuffers::Verifier, pos: usize
1108  ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
1109    use self::flatbuffers::Verifiable;
1110    v.visit_table(pos)?
1111     .visit_field::<flatbuffers::ForwardsUOffset<&str>>("name", Self::VT_NAME, true)?
1112     .visit_field::<flatbuffers::ForwardsUOffset<Type>>("type_", Self::VT_TYPE_, true)?
1113     .visit_field::<u16>("id", Self::VT_ID, false)?
1114     .visit_field::<u16>("offset", Self::VT_OFFSET, false)?
1115     .visit_field::<i64>("default_integer", Self::VT_DEFAULT_INTEGER, false)?
1116     .visit_field::<f64>("default_real", Self::VT_DEFAULT_REAL, false)?
1117     .visit_field::<bool>("deprecated", Self::VT_DEPRECATED, false)?
1118     .visit_field::<bool>("required", Self::VT_REQUIRED, false)?
1119     .visit_field::<bool>("key", Self::VT_KEY, false)?
1120     .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, flatbuffers::ForwardsUOffset<KeyValue>>>>("attributes", Self::VT_ATTRIBUTES, false)?
1121     .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, flatbuffers::ForwardsUOffset<&'_ str>>>>("documentation", Self::VT_DOCUMENTATION, false)?
1122     .visit_field::<bool>("optional", Self::VT_OPTIONAL, false)?
1123     .visit_field::<u16>("padding", Self::VT_PADDING, false)?
1124     .visit_field::<bool>("offset64", Self::VT_OFFSET64, false)?
1125     .finish();
1126    Ok(())
1127  }
1128}
1129pub struct FieldArgs<'a> {
1130    pub name: Option<flatbuffers::WIPOffset<&'a str>>,
1131    pub type_: Option<flatbuffers::WIPOffset<Type<'a>>>,
1132    pub id: u16,
1133    pub offset: u16,
1134    pub default_integer: i64,
1135    pub default_real: f64,
1136    pub deprecated: bool,
1137    pub required: bool,
1138    pub key: bool,
1139    pub attributes: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<KeyValue<'a>>>>>,
1140    pub documentation: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<&'a str>>>>,
1141    pub optional: bool,
1142    pub padding: u16,
1143    pub offset64: bool,
1144}
1145impl<'a> Default for FieldArgs<'a> {
1146  #[inline]
1147  fn default() -> Self {
1148    FieldArgs {
1149      name: None, // required field
1150      type_: None, // required field
1151      id: 0,
1152      offset: 0,
1153      default_integer: 0,
1154      default_real: 0.0,
1155      deprecated: false,
1156      required: false,
1157      key: false,
1158      attributes: None,
1159      documentation: None,
1160      optional: false,
1161      padding: 0,
1162      offset64: false,
1163    }
1164  }
1165}
1166
1167pub struct FieldBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
1168  fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
1169  start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
1170}
1171impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> FieldBuilder<'a, 'b, A> {
1172  #[inline]
1173  pub fn add_name(&mut self, name: flatbuffers::WIPOffset<&'b  str>) {
1174    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Field::VT_NAME, name);
1175  }
1176  #[inline]
1177  pub fn add_type_(&mut self, type_: flatbuffers::WIPOffset<Type<'b >>) {
1178    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<Type>>(Field::VT_TYPE_, type_);
1179  }
1180  #[inline]
1181  pub fn add_id(&mut self, id: u16) {
1182    self.fbb_.push_slot::<u16>(Field::VT_ID, id, 0);
1183  }
1184  #[inline]
1185  pub fn add_offset(&mut self, offset: u16) {
1186    self.fbb_.push_slot::<u16>(Field::VT_OFFSET, offset, 0);
1187  }
1188  #[inline]
1189  pub fn add_default_integer(&mut self, default_integer: i64) {
1190    self.fbb_.push_slot::<i64>(Field::VT_DEFAULT_INTEGER, default_integer, 0);
1191  }
1192  #[inline]
1193  pub fn add_default_real(&mut self, default_real: f64) {
1194    self.fbb_.push_slot::<f64>(Field::VT_DEFAULT_REAL, default_real, 0.0);
1195  }
1196  #[inline]
1197  pub fn add_deprecated(&mut self, deprecated: bool) {
1198    self.fbb_.push_slot::<bool>(Field::VT_DEPRECATED, deprecated, false);
1199  }
1200  #[inline]
1201  pub fn add_required(&mut self, required: bool) {
1202    self.fbb_.push_slot::<bool>(Field::VT_REQUIRED, required, false);
1203  }
1204  #[inline]
1205  pub fn add_key(&mut self, key: bool) {
1206    self.fbb_.push_slot::<bool>(Field::VT_KEY, key, false);
1207  }
1208  #[inline]
1209  pub fn add_attributes(&mut self, attributes: flatbuffers::WIPOffset<flatbuffers::Vector<'b , flatbuffers::ForwardsUOffset<KeyValue<'b >>>>) {
1210    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Field::VT_ATTRIBUTES, attributes);
1211  }
1212  #[inline]
1213  pub fn add_documentation(&mut self, documentation: flatbuffers::WIPOffset<flatbuffers::Vector<'b , flatbuffers::ForwardsUOffset<&'b  str>>>) {
1214    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Field::VT_DOCUMENTATION, documentation);
1215  }
1216  #[inline]
1217  pub fn add_optional(&mut self, optional: bool) {
1218    self.fbb_.push_slot::<bool>(Field::VT_OPTIONAL, optional, false);
1219  }
1220  #[inline]
1221  pub fn add_padding(&mut self, padding: u16) {
1222    self.fbb_.push_slot::<u16>(Field::VT_PADDING, padding, 0);
1223  }
1224  #[inline]
1225  pub fn add_offset64(&mut self, offset64: bool) {
1226    self.fbb_.push_slot::<bool>(Field::VT_OFFSET64, offset64, false);
1227  }
1228  #[inline]
1229  pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> FieldBuilder<'a, 'b, A> {
1230    let start = _fbb.start_table();
1231    FieldBuilder {
1232      fbb_: _fbb,
1233      start_: start,
1234    }
1235  }
1236  #[inline]
1237  pub fn finish(self) -> flatbuffers::WIPOffset<Field<'a>> {
1238    let o = self.fbb_.end_table(self.start_);
1239    self.fbb_.required(o, Field::VT_NAME,"name");
1240    self.fbb_.required(o, Field::VT_TYPE_,"type_");
1241    flatbuffers::WIPOffset::new(o.value())
1242  }
1243}
1244
1245impl core::fmt::Debug for Field<'_> {
1246  fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
1247    let mut ds = f.debug_struct("Field");
1248      ds.field("name", &self.name());
1249      ds.field("type_", &self.type_());
1250      ds.field("id", &self.id());
1251      ds.field("offset", &self.offset());
1252      ds.field("default_integer", &self.default_integer());
1253      ds.field("default_real", &self.default_real());
1254      ds.field("deprecated", &self.deprecated());
1255      ds.field("required", &self.required());
1256      ds.field("key", &self.key());
1257      ds.field("attributes", &self.attributes());
1258      ds.field("documentation", &self.documentation());
1259      ds.field("optional", &self.optional());
1260      ds.field("padding", &self.padding());
1261      ds.field("offset64", &self.offset64());
1262      ds.finish()
1263  }
1264}
1265pub enum ObjectOffset {}
1266#[derive(Copy, Clone, PartialEq)]
1267
1268pub struct Object<'a> {
1269  pub _tab: flatbuffers::Table<'a>,
1270}
1271
1272impl<'a> flatbuffers::Follow<'a> for Object<'a> {
1273  type Inner = Object<'a>;
1274  #[inline]
1275  unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
1276    Self { _tab: flatbuffers::Table::new(buf, loc) }
1277  }
1278}
1279
1280impl<'a> Object<'a> {
1281  pub const VT_NAME: flatbuffers::VOffsetT = 4;
1282  pub const VT_FIELDS: flatbuffers::VOffsetT = 6;
1283  pub const VT_IS_STRUCT: flatbuffers::VOffsetT = 8;
1284  pub const VT_MINALIGN: flatbuffers::VOffsetT = 10;
1285  pub const VT_BYTESIZE: flatbuffers::VOffsetT = 12;
1286  pub const VT_ATTRIBUTES: flatbuffers::VOffsetT = 14;
1287  pub const VT_DOCUMENTATION: flatbuffers::VOffsetT = 16;
1288  pub const VT_DECLARATION_FILE: flatbuffers::VOffsetT = 18;
1289
1290  #[inline]
1291  pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
1292    Object { _tab: table }
1293  }
1294  #[allow(unused_mut)]
1295  pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
1296    _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
1297    args: &'args ObjectArgs<'args>
1298  ) -> flatbuffers::WIPOffset<Object<'bldr>> {
1299    let mut builder = ObjectBuilder::new(_fbb);
1300    if let Some(x) = args.declaration_file { builder.add_declaration_file(x); }
1301    if let Some(x) = args.documentation { builder.add_documentation(x); }
1302    if let Some(x) = args.attributes { builder.add_attributes(x); }
1303    builder.add_bytesize(args.bytesize);
1304    builder.add_minalign(args.minalign);
1305    if let Some(x) = args.fields { builder.add_fields(x); }
1306    if let Some(x) = args.name { builder.add_name(x); }
1307    builder.add_is_struct(args.is_struct);
1308    builder.finish()
1309  }
1310
1311
1312  #[inline]
1313  pub fn name(&self) -> &'a str {
1314    // Safety:
1315    // Created from valid Table for this object
1316    // which contains a valid value in this slot
1317    unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<&str>>(Object::VT_NAME, None).unwrap()}
1318  }
1319  #[inline]
1320  pub fn key_compare_less_than(&self, o: &Object) -> bool {
1321    self.name() < o.name()
1322  }
1323
1324  #[inline]
1325  pub fn key_compare_with_value(&self, val: & str) -> ::core::cmp::Ordering {
1326    let key = self.name();
1327    key.cmp(val)
1328  }
1329  #[inline]
1330  pub fn fields(&self) -> flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<Field<'a>>> {
1331    // Safety:
1332    // Created from valid Table for this object
1333    // which contains a valid value in this slot
1334    unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<Field>>>>(Object::VT_FIELDS, None).unwrap()}
1335  }
1336  #[inline]
1337  pub fn is_struct(&self) -> bool {
1338    // Safety:
1339    // Created from valid Table for this object
1340    // which contains a valid value in this slot
1341    unsafe { self._tab.get::<bool>(Object::VT_IS_STRUCT, Some(false)).unwrap()}
1342  }
1343  #[inline]
1344  pub fn minalign(&self) -> i32 {
1345    // Safety:
1346    // Created from valid Table for this object
1347    // which contains a valid value in this slot
1348    unsafe { self._tab.get::<i32>(Object::VT_MINALIGN, Some(0)).unwrap()}
1349  }
1350  #[inline]
1351  pub fn bytesize(&self) -> i32 {
1352    // Safety:
1353    // Created from valid Table for this object
1354    // which contains a valid value in this slot
1355    unsafe { self._tab.get::<i32>(Object::VT_BYTESIZE, Some(0)).unwrap()}
1356  }
1357  #[inline]
1358  pub fn attributes(&self) -> Option<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<KeyValue<'a>>>> {
1359    // Safety:
1360    // Created from valid Table for this object
1361    // which contains a valid value in this slot
1362    unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<KeyValue>>>>(Object::VT_ATTRIBUTES, None)}
1363  }
1364  #[inline]
1365  pub fn documentation(&self) -> Option<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<&'a str>>> {
1366    // Safety:
1367    // Created from valid Table for this object
1368    // which contains a valid value in this slot
1369    unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<&'a str>>>>(Object::VT_DOCUMENTATION, None)}
1370  }
1371  /// File that this Object is declared in.
1372  #[inline]
1373  pub fn declaration_file(&self) -> Option<&'a str> {
1374    // Safety:
1375    // Created from valid Table for this object
1376    // which contains a valid value in this slot
1377    unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<&str>>(Object::VT_DECLARATION_FILE, None)}
1378  }
1379}
1380
1381impl flatbuffers::Verifiable for Object<'_> {
1382  #[inline]
1383  fn run_verifier(
1384    v: &mut flatbuffers::Verifier, pos: usize
1385  ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
1386    use self::flatbuffers::Verifiable;
1387    v.visit_table(pos)?
1388     .visit_field::<flatbuffers::ForwardsUOffset<&str>>("name", Self::VT_NAME, true)?
1389     .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, flatbuffers::ForwardsUOffset<Field>>>>("fields", Self::VT_FIELDS, true)?
1390     .visit_field::<bool>("is_struct", Self::VT_IS_STRUCT, false)?
1391     .visit_field::<i32>("minalign", Self::VT_MINALIGN, false)?
1392     .visit_field::<i32>("bytesize", Self::VT_BYTESIZE, false)?
1393     .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, flatbuffers::ForwardsUOffset<KeyValue>>>>("attributes", Self::VT_ATTRIBUTES, false)?
1394     .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, flatbuffers::ForwardsUOffset<&'_ str>>>>("documentation", Self::VT_DOCUMENTATION, false)?
1395     .visit_field::<flatbuffers::ForwardsUOffset<&str>>("declaration_file", Self::VT_DECLARATION_FILE, false)?
1396     .finish();
1397    Ok(())
1398  }
1399}
1400pub struct ObjectArgs<'a> {
1401    pub name: Option<flatbuffers::WIPOffset<&'a str>>,
1402    pub fields: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<Field<'a>>>>>,
1403    pub is_struct: bool,
1404    pub minalign: i32,
1405    pub bytesize: i32,
1406    pub attributes: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<KeyValue<'a>>>>>,
1407    pub documentation: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<&'a str>>>>,
1408    pub declaration_file: Option<flatbuffers::WIPOffset<&'a str>>,
1409}
1410impl<'a> Default for ObjectArgs<'a> {
1411  #[inline]
1412  fn default() -> Self {
1413    ObjectArgs {
1414      name: None, // required field
1415      fields: None, // required field
1416      is_struct: false,
1417      minalign: 0,
1418      bytesize: 0,
1419      attributes: None,
1420      documentation: None,
1421      declaration_file: None,
1422    }
1423  }
1424}
1425
1426pub struct ObjectBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
1427  fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
1428  start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
1429}
1430impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> ObjectBuilder<'a, 'b, A> {
1431  #[inline]
1432  pub fn add_name(&mut self, name: flatbuffers::WIPOffset<&'b  str>) {
1433    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Object::VT_NAME, name);
1434  }
1435  #[inline]
1436  pub fn add_fields(&mut self, fields: flatbuffers::WIPOffset<flatbuffers::Vector<'b , flatbuffers::ForwardsUOffset<Field<'b >>>>) {
1437    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Object::VT_FIELDS, fields);
1438  }
1439  #[inline]
1440  pub fn add_is_struct(&mut self, is_struct: bool) {
1441    self.fbb_.push_slot::<bool>(Object::VT_IS_STRUCT, is_struct, false);
1442  }
1443  #[inline]
1444  pub fn add_minalign(&mut self, minalign: i32) {
1445    self.fbb_.push_slot::<i32>(Object::VT_MINALIGN, minalign, 0);
1446  }
1447  #[inline]
1448  pub fn add_bytesize(&mut self, bytesize: i32) {
1449    self.fbb_.push_slot::<i32>(Object::VT_BYTESIZE, bytesize, 0);
1450  }
1451  #[inline]
1452  pub fn add_attributes(&mut self, attributes: flatbuffers::WIPOffset<flatbuffers::Vector<'b , flatbuffers::ForwardsUOffset<KeyValue<'b >>>>) {
1453    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Object::VT_ATTRIBUTES, attributes);
1454  }
1455  #[inline]
1456  pub fn add_documentation(&mut self, documentation: flatbuffers::WIPOffset<flatbuffers::Vector<'b , flatbuffers::ForwardsUOffset<&'b  str>>>) {
1457    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Object::VT_DOCUMENTATION, documentation);
1458  }
1459  #[inline]
1460  pub fn add_declaration_file(&mut self, declaration_file: flatbuffers::WIPOffset<&'b  str>) {
1461    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Object::VT_DECLARATION_FILE, declaration_file);
1462  }
1463  #[inline]
1464  pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> ObjectBuilder<'a, 'b, A> {
1465    let start = _fbb.start_table();
1466    ObjectBuilder {
1467      fbb_: _fbb,
1468      start_: start,
1469    }
1470  }
1471  #[inline]
1472  pub fn finish(self) -> flatbuffers::WIPOffset<Object<'a>> {
1473    let o = self.fbb_.end_table(self.start_);
1474    self.fbb_.required(o, Object::VT_NAME,"name");
1475    self.fbb_.required(o, Object::VT_FIELDS,"fields");
1476    flatbuffers::WIPOffset::new(o.value())
1477  }
1478}
1479
1480impl core::fmt::Debug for Object<'_> {
1481  fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
1482    let mut ds = f.debug_struct("Object");
1483      ds.field("name", &self.name());
1484      ds.field("fields", &self.fields());
1485      ds.field("is_struct", &self.is_struct());
1486      ds.field("minalign", &self.minalign());
1487      ds.field("bytesize", &self.bytesize());
1488      ds.field("attributes", &self.attributes());
1489      ds.field("documentation", &self.documentation());
1490      ds.field("declaration_file", &self.declaration_file());
1491      ds.finish()
1492  }
1493}
1494pub enum RPCCallOffset {}
1495#[derive(Copy, Clone, PartialEq)]
1496
1497pub struct RPCCall<'a> {
1498  pub _tab: flatbuffers::Table<'a>,
1499}
1500
1501impl<'a> flatbuffers::Follow<'a> for RPCCall<'a> {
1502  type Inner = RPCCall<'a>;
1503  #[inline]
1504  unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
1505    Self { _tab: flatbuffers::Table::new(buf, loc) }
1506  }
1507}
1508
1509impl<'a> RPCCall<'a> {
1510  pub const VT_NAME: flatbuffers::VOffsetT = 4;
1511  pub const VT_REQUEST: flatbuffers::VOffsetT = 6;
1512  pub const VT_RESPONSE: flatbuffers::VOffsetT = 8;
1513  pub const VT_ATTRIBUTES: flatbuffers::VOffsetT = 10;
1514  pub const VT_DOCUMENTATION: flatbuffers::VOffsetT = 12;
1515
1516  #[inline]
1517  pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
1518    RPCCall { _tab: table }
1519  }
1520  #[allow(unused_mut)]
1521  pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
1522    _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
1523    args: &'args RPCCallArgs<'args>
1524  ) -> flatbuffers::WIPOffset<RPCCall<'bldr>> {
1525    let mut builder = RPCCallBuilder::new(_fbb);
1526    if let Some(x) = args.documentation { builder.add_documentation(x); }
1527    if let Some(x) = args.attributes { builder.add_attributes(x); }
1528    if let Some(x) = args.response { builder.add_response(x); }
1529    if let Some(x) = args.request { builder.add_request(x); }
1530    if let Some(x) = args.name { builder.add_name(x); }
1531    builder.finish()
1532  }
1533
1534
1535  #[inline]
1536  pub fn name(&self) -> &'a str {
1537    // Safety:
1538    // Created from valid Table for this object
1539    // which contains a valid value in this slot
1540    unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<&str>>(RPCCall::VT_NAME, None).unwrap()}
1541  }
1542  #[inline]
1543  pub fn key_compare_less_than(&self, o: &RPCCall) -> bool {
1544    self.name() < o.name()
1545  }
1546
1547  #[inline]
1548  pub fn key_compare_with_value(&self, val: & str) -> ::core::cmp::Ordering {
1549    let key = self.name();
1550    key.cmp(val)
1551  }
1552  #[inline]
1553  pub fn request(&self) -> Object<'a> {
1554    // Safety:
1555    // Created from valid Table for this object
1556    // which contains a valid value in this slot
1557    unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<Object>>(RPCCall::VT_REQUEST, None).unwrap()}
1558  }
1559  #[inline]
1560  pub fn response(&self) -> Object<'a> {
1561    // Safety:
1562    // Created from valid Table for this object
1563    // which contains a valid value in this slot
1564    unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<Object>>(RPCCall::VT_RESPONSE, None).unwrap()}
1565  }
1566  #[inline]
1567  pub fn attributes(&self) -> Option<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<KeyValue<'a>>>> {
1568    // Safety:
1569    // Created from valid Table for this object
1570    // which contains a valid value in this slot
1571    unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<KeyValue>>>>(RPCCall::VT_ATTRIBUTES, None)}
1572  }
1573  #[inline]
1574  pub fn documentation(&self) -> Option<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<&'a str>>> {
1575    // Safety:
1576    // Created from valid Table for this object
1577    // which contains a valid value in this slot
1578    unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<&'a str>>>>(RPCCall::VT_DOCUMENTATION, None)}
1579  }
1580}
1581
1582impl flatbuffers::Verifiable for RPCCall<'_> {
1583  #[inline]
1584  fn run_verifier(
1585    v: &mut flatbuffers::Verifier, pos: usize
1586  ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
1587    use self::flatbuffers::Verifiable;
1588    v.visit_table(pos)?
1589     .visit_field::<flatbuffers::ForwardsUOffset<&str>>("name", Self::VT_NAME, true)?
1590     .visit_field::<flatbuffers::ForwardsUOffset<Object>>("request", Self::VT_REQUEST, true)?
1591     .visit_field::<flatbuffers::ForwardsUOffset<Object>>("response", Self::VT_RESPONSE, true)?
1592     .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, flatbuffers::ForwardsUOffset<KeyValue>>>>("attributes", Self::VT_ATTRIBUTES, false)?
1593     .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, flatbuffers::ForwardsUOffset<&'_ str>>>>("documentation", Self::VT_DOCUMENTATION, false)?
1594     .finish();
1595    Ok(())
1596  }
1597}
1598pub struct RPCCallArgs<'a> {
1599    pub name: Option<flatbuffers::WIPOffset<&'a str>>,
1600    pub request: Option<flatbuffers::WIPOffset<Object<'a>>>,
1601    pub response: Option<flatbuffers::WIPOffset<Object<'a>>>,
1602    pub attributes: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<KeyValue<'a>>>>>,
1603    pub documentation: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<&'a str>>>>,
1604}
1605impl<'a> Default for RPCCallArgs<'a> {
1606  #[inline]
1607  fn default() -> Self {
1608    RPCCallArgs {
1609      name: None, // required field
1610      request: None, // required field
1611      response: None, // required field
1612      attributes: None,
1613      documentation: None,
1614    }
1615  }
1616}
1617
1618pub struct RPCCallBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
1619  fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
1620  start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
1621}
1622impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> RPCCallBuilder<'a, 'b, A> {
1623  #[inline]
1624  pub fn add_name(&mut self, name: flatbuffers::WIPOffset<&'b  str>) {
1625    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(RPCCall::VT_NAME, name);
1626  }
1627  #[inline]
1628  pub fn add_request(&mut self, request: flatbuffers::WIPOffset<Object<'b >>) {
1629    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<Object>>(RPCCall::VT_REQUEST, request);
1630  }
1631  #[inline]
1632  pub fn add_response(&mut self, response: flatbuffers::WIPOffset<Object<'b >>) {
1633    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<Object>>(RPCCall::VT_RESPONSE, response);
1634  }
1635  #[inline]
1636  pub fn add_attributes(&mut self, attributes: flatbuffers::WIPOffset<flatbuffers::Vector<'b , flatbuffers::ForwardsUOffset<KeyValue<'b >>>>) {
1637    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(RPCCall::VT_ATTRIBUTES, attributes);
1638  }
1639  #[inline]
1640  pub fn add_documentation(&mut self, documentation: flatbuffers::WIPOffset<flatbuffers::Vector<'b , flatbuffers::ForwardsUOffset<&'b  str>>>) {
1641    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(RPCCall::VT_DOCUMENTATION, documentation);
1642  }
1643  #[inline]
1644  pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> RPCCallBuilder<'a, 'b, A> {
1645    let start = _fbb.start_table();
1646    RPCCallBuilder {
1647      fbb_: _fbb,
1648      start_: start,
1649    }
1650  }
1651  #[inline]
1652  pub fn finish(self) -> flatbuffers::WIPOffset<RPCCall<'a>> {
1653    let o = self.fbb_.end_table(self.start_);
1654    self.fbb_.required(o, RPCCall::VT_NAME,"name");
1655    self.fbb_.required(o, RPCCall::VT_REQUEST,"request");
1656    self.fbb_.required(o, RPCCall::VT_RESPONSE,"response");
1657    flatbuffers::WIPOffset::new(o.value())
1658  }
1659}
1660
1661impl core::fmt::Debug for RPCCall<'_> {
1662  fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
1663    let mut ds = f.debug_struct("RPCCall");
1664      ds.field("name", &self.name());
1665      ds.field("request", &self.request());
1666      ds.field("response", &self.response());
1667      ds.field("attributes", &self.attributes());
1668      ds.field("documentation", &self.documentation());
1669      ds.finish()
1670  }
1671}
1672pub enum ServiceOffset {}
1673#[derive(Copy, Clone, PartialEq)]
1674
1675pub struct Service<'a> {
1676  pub _tab: flatbuffers::Table<'a>,
1677}
1678
1679impl<'a> flatbuffers::Follow<'a> for Service<'a> {
1680  type Inner = Service<'a>;
1681  #[inline]
1682  unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
1683    Self { _tab: flatbuffers::Table::new(buf, loc) }
1684  }
1685}
1686
1687impl<'a> Service<'a> {
1688  pub const VT_NAME: flatbuffers::VOffsetT = 4;
1689  pub const VT_CALLS: flatbuffers::VOffsetT = 6;
1690  pub const VT_ATTRIBUTES: flatbuffers::VOffsetT = 8;
1691  pub const VT_DOCUMENTATION: flatbuffers::VOffsetT = 10;
1692  pub const VT_DECLARATION_FILE: flatbuffers::VOffsetT = 12;
1693
1694  #[inline]
1695  pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
1696    Service { _tab: table }
1697  }
1698  #[allow(unused_mut)]
1699  pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
1700    _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
1701    args: &'args ServiceArgs<'args>
1702  ) -> flatbuffers::WIPOffset<Service<'bldr>> {
1703    let mut builder = ServiceBuilder::new(_fbb);
1704    if let Some(x) = args.declaration_file { builder.add_declaration_file(x); }
1705    if let Some(x) = args.documentation { builder.add_documentation(x); }
1706    if let Some(x) = args.attributes { builder.add_attributes(x); }
1707    if let Some(x) = args.calls { builder.add_calls(x); }
1708    if let Some(x) = args.name { builder.add_name(x); }
1709    builder.finish()
1710  }
1711
1712
1713  #[inline]
1714  pub fn name(&self) -> &'a str {
1715    // Safety:
1716    // Created from valid Table for this object
1717    // which contains a valid value in this slot
1718    unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<&str>>(Service::VT_NAME, None).unwrap()}
1719  }
1720  #[inline]
1721  pub fn key_compare_less_than(&self, o: &Service) -> bool {
1722    self.name() < o.name()
1723  }
1724
1725  #[inline]
1726  pub fn key_compare_with_value(&self, val: & str) -> ::core::cmp::Ordering {
1727    let key = self.name();
1728    key.cmp(val)
1729  }
1730  #[inline]
1731  pub fn calls(&self) -> Option<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<RPCCall<'a>>>> {
1732    // Safety:
1733    // Created from valid Table for this object
1734    // which contains a valid value in this slot
1735    unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<RPCCall>>>>(Service::VT_CALLS, None)}
1736  }
1737  #[inline]
1738  pub fn attributes(&self) -> Option<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<KeyValue<'a>>>> {
1739    // Safety:
1740    // Created from valid Table for this object
1741    // which contains a valid value in this slot
1742    unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<KeyValue>>>>(Service::VT_ATTRIBUTES, None)}
1743  }
1744  #[inline]
1745  pub fn documentation(&self) -> Option<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<&'a str>>> {
1746    // Safety:
1747    // Created from valid Table for this object
1748    // which contains a valid value in this slot
1749    unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<&'a str>>>>(Service::VT_DOCUMENTATION, None)}
1750  }
1751  /// File that this Service is declared in.
1752  #[inline]
1753  pub fn declaration_file(&self) -> Option<&'a str> {
1754    // Safety:
1755    // Created from valid Table for this object
1756    // which contains a valid value in this slot
1757    unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<&str>>(Service::VT_DECLARATION_FILE, None)}
1758  }
1759}
1760
1761impl flatbuffers::Verifiable for Service<'_> {
1762  #[inline]
1763  fn run_verifier(
1764    v: &mut flatbuffers::Verifier, pos: usize
1765  ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
1766    use self::flatbuffers::Verifiable;
1767    v.visit_table(pos)?
1768     .visit_field::<flatbuffers::ForwardsUOffset<&str>>("name", Self::VT_NAME, true)?
1769     .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, flatbuffers::ForwardsUOffset<RPCCall>>>>("calls", Self::VT_CALLS, false)?
1770     .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, flatbuffers::ForwardsUOffset<KeyValue>>>>("attributes", Self::VT_ATTRIBUTES, false)?
1771     .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, flatbuffers::ForwardsUOffset<&'_ str>>>>("documentation", Self::VT_DOCUMENTATION, false)?
1772     .visit_field::<flatbuffers::ForwardsUOffset<&str>>("declaration_file", Self::VT_DECLARATION_FILE, false)?
1773     .finish();
1774    Ok(())
1775  }
1776}
1777pub struct ServiceArgs<'a> {
1778    pub name: Option<flatbuffers::WIPOffset<&'a str>>,
1779    pub calls: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<RPCCall<'a>>>>>,
1780    pub attributes: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<KeyValue<'a>>>>>,
1781    pub documentation: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<&'a str>>>>,
1782    pub declaration_file: Option<flatbuffers::WIPOffset<&'a str>>,
1783}
1784impl<'a> Default for ServiceArgs<'a> {
1785  #[inline]
1786  fn default() -> Self {
1787    ServiceArgs {
1788      name: None, // required field
1789      calls: None,
1790      attributes: None,
1791      documentation: None,
1792      declaration_file: None,
1793    }
1794  }
1795}
1796
1797pub struct ServiceBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
1798  fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
1799  start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
1800}
1801impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> ServiceBuilder<'a, 'b, A> {
1802  #[inline]
1803  pub fn add_name(&mut self, name: flatbuffers::WIPOffset<&'b  str>) {
1804    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Service::VT_NAME, name);
1805  }
1806  #[inline]
1807  pub fn add_calls(&mut self, calls: flatbuffers::WIPOffset<flatbuffers::Vector<'b , flatbuffers::ForwardsUOffset<RPCCall<'b >>>>) {
1808    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Service::VT_CALLS, calls);
1809  }
1810  #[inline]
1811  pub fn add_attributes(&mut self, attributes: flatbuffers::WIPOffset<flatbuffers::Vector<'b , flatbuffers::ForwardsUOffset<KeyValue<'b >>>>) {
1812    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Service::VT_ATTRIBUTES, attributes);
1813  }
1814  #[inline]
1815  pub fn add_documentation(&mut self, documentation: flatbuffers::WIPOffset<flatbuffers::Vector<'b , flatbuffers::ForwardsUOffset<&'b  str>>>) {
1816    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Service::VT_DOCUMENTATION, documentation);
1817  }
1818  #[inline]
1819  pub fn add_declaration_file(&mut self, declaration_file: flatbuffers::WIPOffset<&'b  str>) {
1820    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Service::VT_DECLARATION_FILE, declaration_file);
1821  }
1822  #[inline]
1823  pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> ServiceBuilder<'a, 'b, A> {
1824    let start = _fbb.start_table();
1825    ServiceBuilder {
1826      fbb_: _fbb,
1827      start_: start,
1828    }
1829  }
1830  #[inline]
1831  pub fn finish(self) -> flatbuffers::WIPOffset<Service<'a>> {
1832    let o = self.fbb_.end_table(self.start_);
1833    self.fbb_.required(o, Service::VT_NAME,"name");
1834    flatbuffers::WIPOffset::new(o.value())
1835  }
1836}
1837
1838impl core::fmt::Debug for Service<'_> {
1839  fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
1840    let mut ds = f.debug_struct("Service");
1841      ds.field("name", &self.name());
1842      ds.field("calls", &self.calls());
1843      ds.field("attributes", &self.attributes());
1844      ds.field("documentation", &self.documentation());
1845      ds.field("declaration_file", &self.declaration_file());
1846      ds.finish()
1847  }
1848}
1849pub enum SchemaFileOffset {}
1850#[derive(Copy, Clone, PartialEq)]
1851
1852/// File specific information.
1853/// Symbols declared within a file may be recovered by iterating over all
1854/// symbols and examining the `declaration_file` field.
1855pub struct SchemaFile<'a> {
1856  pub _tab: flatbuffers::Table<'a>,
1857}
1858
1859impl<'a> flatbuffers::Follow<'a> for SchemaFile<'a> {
1860  type Inner = SchemaFile<'a>;
1861  #[inline]
1862  unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
1863    Self { _tab: flatbuffers::Table::new(buf, loc) }
1864  }
1865}
1866
1867impl<'a> SchemaFile<'a> {
1868  pub const VT_FILENAME: flatbuffers::VOffsetT = 4;
1869  pub const VT_INCLUDED_FILENAMES: flatbuffers::VOffsetT = 6;
1870
1871  #[inline]
1872  pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
1873    SchemaFile { _tab: table }
1874  }
1875  #[allow(unused_mut)]
1876  pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
1877    _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
1878    args: &'args SchemaFileArgs<'args>
1879  ) -> flatbuffers::WIPOffset<SchemaFile<'bldr>> {
1880    let mut builder = SchemaFileBuilder::new(_fbb);
1881    if let Some(x) = args.included_filenames { builder.add_included_filenames(x); }
1882    if let Some(x) = args.filename { builder.add_filename(x); }
1883    builder.finish()
1884  }
1885
1886
1887  /// Filename, relative to project root.
1888  #[inline]
1889  pub fn filename(&self) -> &'a str {
1890    // Safety:
1891    // Created from valid Table for this object
1892    // which contains a valid value in this slot
1893    unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<&str>>(SchemaFile::VT_FILENAME, None).unwrap()}
1894  }
1895  #[inline]
1896  pub fn key_compare_less_than(&self, o: &SchemaFile) -> bool {
1897    self.filename() < o.filename()
1898  }
1899
1900  #[inline]
1901  pub fn key_compare_with_value(&self, val: & str) -> ::core::cmp::Ordering {
1902    let key = self.filename();
1903    key.cmp(val)
1904  }
1905  /// Names of included files, relative to project root.
1906  #[inline]
1907  pub fn included_filenames(&self) -> Option<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<&'a str>>> {
1908    // Safety:
1909    // Created from valid Table for this object
1910    // which contains a valid value in this slot
1911    unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<&'a str>>>>(SchemaFile::VT_INCLUDED_FILENAMES, None)}
1912  }
1913}
1914
1915impl flatbuffers::Verifiable for SchemaFile<'_> {
1916  #[inline]
1917  fn run_verifier(
1918    v: &mut flatbuffers::Verifier, pos: usize
1919  ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
1920    use self::flatbuffers::Verifiable;
1921    v.visit_table(pos)?
1922     .visit_field::<flatbuffers::ForwardsUOffset<&str>>("filename", Self::VT_FILENAME, true)?
1923     .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, flatbuffers::ForwardsUOffset<&'_ str>>>>("included_filenames", Self::VT_INCLUDED_FILENAMES, false)?
1924     .finish();
1925    Ok(())
1926  }
1927}
1928pub struct SchemaFileArgs<'a> {
1929    pub filename: Option<flatbuffers::WIPOffset<&'a str>>,
1930    pub included_filenames: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<&'a str>>>>,
1931}
1932impl<'a> Default for SchemaFileArgs<'a> {
1933  #[inline]
1934  fn default() -> Self {
1935    SchemaFileArgs {
1936      filename: None, // required field
1937      included_filenames: None,
1938    }
1939  }
1940}
1941
1942pub struct SchemaFileBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
1943  fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
1944  start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
1945}
1946impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> SchemaFileBuilder<'a, 'b, A> {
1947  #[inline]
1948  pub fn add_filename(&mut self, filename: flatbuffers::WIPOffset<&'b  str>) {
1949    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(SchemaFile::VT_FILENAME, filename);
1950  }
1951  #[inline]
1952  pub fn add_included_filenames(&mut self, included_filenames: flatbuffers::WIPOffset<flatbuffers::Vector<'b , flatbuffers::ForwardsUOffset<&'b  str>>>) {
1953    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(SchemaFile::VT_INCLUDED_FILENAMES, included_filenames);
1954  }
1955  #[inline]
1956  pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> SchemaFileBuilder<'a, 'b, A> {
1957    let start = _fbb.start_table();
1958    SchemaFileBuilder {
1959      fbb_: _fbb,
1960      start_: start,
1961    }
1962  }
1963  #[inline]
1964  pub fn finish(self) -> flatbuffers::WIPOffset<SchemaFile<'a>> {
1965    let o = self.fbb_.end_table(self.start_);
1966    self.fbb_.required(o, SchemaFile::VT_FILENAME,"filename");
1967    flatbuffers::WIPOffset::new(o.value())
1968  }
1969}
1970
1971impl core::fmt::Debug for SchemaFile<'_> {
1972  fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
1973    let mut ds = f.debug_struct("SchemaFile");
1974      ds.field("filename", &self.filename());
1975      ds.field("included_filenames", &self.included_filenames());
1976      ds.finish()
1977  }
1978}
1979pub enum SchemaOffset {}
1980#[derive(Copy, Clone, PartialEq)]
1981
1982pub struct Schema<'a> {
1983  pub _tab: flatbuffers::Table<'a>,
1984}
1985
1986impl<'a> flatbuffers::Follow<'a> for Schema<'a> {
1987  type Inner = Schema<'a>;
1988  #[inline]
1989  unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
1990    Self { _tab: flatbuffers::Table::new(buf, loc) }
1991  }
1992}
1993
1994impl<'a> Schema<'a> {
1995  pub const VT_OBJECTS: flatbuffers::VOffsetT = 4;
1996  pub const VT_ENUMS: flatbuffers::VOffsetT = 6;
1997  pub const VT_FILE_IDENT: flatbuffers::VOffsetT = 8;
1998  pub const VT_FILE_EXT: flatbuffers::VOffsetT = 10;
1999  pub const VT_ROOT_TABLE: flatbuffers::VOffsetT = 12;
2000  pub const VT_SERVICES: flatbuffers::VOffsetT = 14;
2001  pub const VT_ADVANCED_FEATURES: flatbuffers::VOffsetT = 16;
2002  pub const VT_FBS_FILES: flatbuffers::VOffsetT = 18;
2003
2004  #[inline]
2005  pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
2006    Schema { _tab: table }
2007  }
2008  #[allow(unused_mut)]
2009  pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
2010    _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
2011    args: &'args SchemaArgs<'args>
2012  ) -> flatbuffers::WIPOffset<Schema<'bldr>> {
2013    let mut builder = SchemaBuilder::new(_fbb);
2014    builder.add_advanced_features(args.advanced_features);
2015    if let Some(x) = args.fbs_files { builder.add_fbs_files(x); }
2016    if let Some(x) = args.services { builder.add_services(x); }
2017    if let Some(x) = args.root_table { builder.add_root_table(x); }
2018    if let Some(x) = args.file_ext { builder.add_file_ext(x); }
2019    if let Some(x) = args.file_ident { builder.add_file_ident(x); }
2020    if let Some(x) = args.enums { builder.add_enums(x); }
2021    if let Some(x) = args.objects { builder.add_objects(x); }
2022    builder.finish()
2023  }
2024
2025
2026  #[inline]
2027  pub fn objects(&self) -> flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<Object<'a>>> {
2028    // Safety:
2029    // Created from valid Table for this object
2030    // which contains a valid value in this slot
2031    unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<Object>>>>(Schema::VT_OBJECTS, None).unwrap()}
2032  }
2033  #[inline]
2034  pub fn enums(&self) -> flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<Enum<'a>>> {
2035    // Safety:
2036    // Created from valid Table for this object
2037    // which contains a valid value in this slot
2038    unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<Enum>>>>(Schema::VT_ENUMS, None).unwrap()}
2039  }
2040  #[inline]
2041  pub fn file_ident(&self) -> Option<&'a str> {
2042    // Safety:
2043    // Created from valid Table for this object
2044    // which contains a valid value in this slot
2045    unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<&str>>(Schema::VT_FILE_IDENT, None)}
2046  }
2047  #[inline]
2048  pub fn file_ext(&self) -> Option<&'a str> {
2049    // Safety:
2050    // Created from valid Table for this object
2051    // which contains a valid value in this slot
2052    unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<&str>>(Schema::VT_FILE_EXT, None)}
2053  }
2054  #[inline]
2055  pub fn root_table(&self) -> Option<Object<'a>> {
2056    // Safety:
2057    // Created from valid Table for this object
2058    // which contains a valid value in this slot
2059    unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<Object>>(Schema::VT_ROOT_TABLE, None)}
2060  }
2061  #[inline]
2062  pub fn services(&self) -> Option<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<Service<'a>>>> {
2063    // Safety:
2064    // Created from valid Table for this object
2065    // which contains a valid value in this slot
2066    unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<Service>>>>(Schema::VT_SERVICES, None)}
2067  }
2068  #[inline]
2069  pub fn advanced_features(&self) -> AdvancedFeatures {
2070    // Safety:
2071    // Created from valid Table for this object
2072    // which contains a valid value in this slot
2073    unsafe { self._tab.get::<AdvancedFeatures>(Schema::VT_ADVANCED_FEATURES, Some(Default::default())).unwrap()}
2074  }
2075  /// All the files used in this compilation. Files are relative to where
2076  /// flatc was invoked.
2077  #[inline]
2078  pub fn fbs_files(&self) -> Option<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<SchemaFile<'a>>>> {
2079    // Safety:
2080    // Created from valid Table for this object
2081    // which contains a valid value in this slot
2082    unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<SchemaFile>>>>(Schema::VT_FBS_FILES, None)}
2083  }
2084}
2085
2086impl flatbuffers::Verifiable for Schema<'_> {
2087  #[inline]
2088  fn run_verifier(
2089    v: &mut flatbuffers::Verifier, pos: usize
2090  ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
2091    use self::flatbuffers::Verifiable;
2092    v.visit_table(pos)?
2093     .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, flatbuffers::ForwardsUOffset<Object>>>>("objects", Self::VT_OBJECTS, true)?
2094     .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, flatbuffers::ForwardsUOffset<Enum>>>>("enums", Self::VT_ENUMS, true)?
2095     .visit_field::<flatbuffers::ForwardsUOffset<&str>>("file_ident", Self::VT_FILE_IDENT, false)?
2096     .visit_field::<flatbuffers::ForwardsUOffset<&str>>("file_ext", Self::VT_FILE_EXT, false)?
2097     .visit_field::<flatbuffers::ForwardsUOffset<Object>>("root_table", Self::VT_ROOT_TABLE, false)?
2098     .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, flatbuffers::ForwardsUOffset<Service>>>>("services", Self::VT_SERVICES, false)?
2099     .visit_field::<AdvancedFeatures>("advanced_features", Self::VT_ADVANCED_FEATURES, false)?
2100     .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, flatbuffers::ForwardsUOffset<SchemaFile>>>>("fbs_files", Self::VT_FBS_FILES, false)?
2101     .finish();
2102    Ok(())
2103  }
2104}
2105pub struct SchemaArgs<'a> {
2106    pub objects: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<Object<'a>>>>>,
2107    pub enums: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<Enum<'a>>>>>,
2108    pub file_ident: Option<flatbuffers::WIPOffset<&'a str>>,
2109    pub file_ext: Option<flatbuffers::WIPOffset<&'a str>>,
2110    pub root_table: Option<flatbuffers::WIPOffset<Object<'a>>>,
2111    pub services: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<Service<'a>>>>>,
2112    pub advanced_features: AdvancedFeatures,
2113    pub fbs_files: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<SchemaFile<'a>>>>>,
2114}
2115impl<'a> Default for SchemaArgs<'a> {
2116  #[inline]
2117  fn default() -> Self {
2118    SchemaArgs {
2119      objects: None, // required field
2120      enums: None, // required field
2121      file_ident: None,
2122      file_ext: None,
2123      root_table: None,
2124      services: None,
2125      advanced_features: Default::default(),
2126      fbs_files: None,
2127    }
2128  }
2129}
2130
2131pub struct SchemaBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
2132  fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
2133  start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
2134}
2135impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> SchemaBuilder<'a, 'b, A> {
2136  #[inline]
2137  pub fn add_objects(&mut self, objects: flatbuffers::WIPOffset<flatbuffers::Vector<'b , flatbuffers::ForwardsUOffset<Object<'b >>>>) {
2138    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Schema::VT_OBJECTS, objects);
2139  }
2140  #[inline]
2141  pub fn add_enums(&mut self, enums: flatbuffers::WIPOffset<flatbuffers::Vector<'b , flatbuffers::ForwardsUOffset<Enum<'b >>>>) {
2142    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Schema::VT_ENUMS, enums);
2143  }
2144  #[inline]
2145  pub fn add_file_ident(&mut self, file_ident: flatbuffers::WIPOffset<&'b  str>) {
2146    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Schema::VT_FILE_IDENT, file_ident);
2147  }
2148  #[inline]
2149  pub fn add_file_ext(&mut self, file_ext: flatbuffers::WIPOffset<&'b  str>) {
2150    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Schema::VT_FILE_EXT, file_ext);
2151  }
2152  #[inline]
2153  pub fn add_root_table(&mut self, root_table: flatbuffers::WIPOffset<Object<'b >>) {
2154    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<Object>>(Schema::VT_ROOT_TABLE, root_table);
2155  }
2156  #[inline]
2157  pub fn add_services(&mut self, services: flatbuffers::WIPOffset<flatbuffers::Vector<'b , flatbuffers::ForwardsUOffset<Service<'b >>>>) {
2158    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Schema::VT_SERVICES, services);
2159  }
2160  #[inline]
2161  pub fn add_advanced_features(&mut self, advanced_features: AdvancedFeatures) {
2162    self.fbb_.push_slot::<AdvancedFeatures>(Schema::VT_ADVANCED_FEATURES, advanced_features, Default::default());
2163  }
2164  #[inline]
2165  pub fn add_fbs_files(&mut self, fbs_files: flatbuffers::WIPOffset<flatbuffers::Vector<'b , flatbuffers::ForwardsUOffset<SchemaFile<'b >>>>) {
2166    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Schema::VT_FBS_FILES, fbs_files);
2167  }
2168  #[inline]
2169  pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> SchemaBuilder<'a, 'b, A> {
2170    let start = _fbb.start_table();
2171    SchemaBuilder {
2172      fbb_: _fbb,
2173      start_: start,
2174    }
2175  }
2176  #[inline]
2177  pub fn finish(self) -> flatbuffers::WIPOffset<Schema<'a>> {
2178    let o = self.fbb_.end_table(self.start_);
2179    self.fbb_.required(o, Schema::VT_OBJECTS,"objects");
2180    self.fbb_.required(o, Schema::VT_ENUMS,"enums");
2181    flatbuffers::WIPOffset::new(o.value())
2182  }
2183}
2184
2185impl core::fmt::Debug for Schema<'_> {
2186  fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
2187    let mut ds = f.debug_struct("Schema");
2188      ds.field("objects", &self.objects());
2189      ds.field("enums", &self.enums());
2190      ds.field("file_ident", &self.file_ident());
2191      ds.field("file_ext", &self.file_ext());
2192      ds.field("root_table", &self.root_table());
2193      ds.field("services", &self.services());
2194      ds.field("advanced_features", &self.advanced_features());
2195      ds.field("fbs_files", &self.fbs_files());
2196      ds.finish()
2197  }
2198}
2199#[inline]
2200/// Verifies that a buffer of bytes contains a `Schema`
2201/// and returns it.
2202/// Note that verification is still experimental and may not
2203/// catch every error, or be maximally performant. For the
2204/// previous, unchecked, behavior use
2205/// `root_as_schema_unchecked`.
2206pub fn root_as_schema(buf: &[u8]) -> Result<Schema, flatbuffers::InvalidFlatbuffer> {
2207  flatbuffers::root::<Schema>(buf)
2208}
2209#[inline]
2210/// Verifies that a buffer of bytes contains a size prefixed
2211/// `Schema` and returns it.
2212/// Note that verification is still experimental and may not
2213/// catch every error, or be maximally performant. For the
2214/// previous, unchecked, behavior use
2215/// `size_prefixed_root_as_schema_unchecked`.
2216pub fn size_prefixed_root_as_schema(buf: &[u8]) -> Result<Schema, flatbuffers::InvalidFlatbuffer> {
2217  flatbuffers::size_prefixed_root::<Schema>(buf)
2218}
2219#[inline]
2220/// Verifies, with the given options, that a buffer of bytes
2221/// contains a `Schema` and returns it.
2222/// Note that verification is still experimental and may not
2223/// catch every error, or be maximally performant. For the
2224/// previous, unchecked, behavior use
2225/// `root_as_schema_unchecked`.
2226pub fn root_as_schema_with_opts<'b, 'o>(
2227  opts: &'o flatbuffers::VerifierOptions,
2228  buf: &'b [u8],
2229) -> Result<Schema<'b>, flatbuffers::InvalidFlatbuffer> {
2230  flatbuffers::root_with_opts::<Schema<'b>>(opts, buf)
2231}
2232#[inline]
2233/// Verifies, with the given verifier options, that a buffer of
2234/// bytes contains a size prefixed `Schema` and returns
2235/// it. Note that verification is still experimental and may not
2236/// catch every error, or be maximally performant. For the
2237/// previous, unchecked, behavior use
2238/// `root_as_schema_unchecked`.
2239pub fn size_prefixed_root_as_schema_with_opts<'b, 'o>(
2240  opts: &'o flatbuffers::VerifierOptions,
2241  buf: &'b [u8],
2242) -> Result<Schema<'b>, flatbuffers::InvalidFlatbuffer> {
2243  flatbuffers::size_prefixed_root_with_opts::<Schema<'b>>(opts, buf)
2244}
2245#[inline]
2246/// Assumes, without verification, that a buffer of bytes contains a Schema and returns it.
2247/// # Safety
2248/// Callers must trust the given bytes do indeed contain a valid `Schema`.
2249pub unsafe fn root_as_schema_unchecked(buf: &[u8]) -> Schema {
2250  flatbuffers::root_unchecked::<Schema>(buf)
2251}
2252#[inline]
2253/// Assumes, without verification, that a buffer of bytes contains a size prefixed Schema and returns it.
2254/// # Safety
2255/// Callers must trust the given bytes do indeed contain a valid size prefixed `Schema`.
2256pub unsafe fn size_prefixed_root_as_schema_unchecked(buf: &[u8]) -> Schema {
2257  flatbuffers::size_prefixed_root_unchecked::<Schema>(buf)
2258}
2259pub const SCHEMA_IDENTIFIER: &str = "BFBS";
2260
2261#[inline]
2262pub fn schema_buffer_has_identifier(buf: &[u8]) -> bool {
2263  flatbuffers::buffer_has_identifier(buf, SCHEMA_IDENTIFIER, false)
2264}
2265
2266#[inline]
2267pub fn schema_size_prefixed_buffer_has_identifier(buf: &[u8]) -> bool {
2268  flatbuffers::buffer_has_identifier(buf, SCHEMA_IDENTIFIER, true)
2269}
2270
2271pub const SCHEMA_EXTENSION: &str = "bfbs";
2272
2273#[inline]
2274pub fn finish_schema_buffer<'a, 'b, A: flatbuffers::Allocator + 'a>(
2275    fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
2276    root: flatbuffers::WIPOffset<Schema<'a>>) {
2277  fbb.finish(root, Some(SCHEMA_IDENTIFIER));
2278}
2279
2280#[inline]
2281pub fn finish_size_prefixed_schema_buffer<'a, 'b, A: flatbuffers::Allocator + 'a>(fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>, root: flatbuffers::WIPOffset<Schema<'a>>) {
2282  fbb.finish_size_prefixed(root, Some(SCHEMA_IDENTIFIER));
2283}
2284}  // pub mod reflection
2285