• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // automatically generated by the FlatBuffers compiler, do not modify
2 
3 
4 
5 use crate::include_test1_generated::*;
6 use crate::include_test2_generated::*;
7 use std::mem;
8 use std::cmp::Ordering;
9 
10 extern crate flatbuffers;
11 use self::flatbuffers::EndianScalar;
12 
13 #[allow(unused_imports, dead_code)]
14 pub mod my_game {
15 
16   use crate::include_test1_generated::*;
17   use crate::include_test2_generated::*;
18   use std::mem;
19   use std::cmp::Ordering;
20 
21   extern crate flatbuffers;
22   use self::flatbuffers::EndianScalar;
23 
24 pub enum InParentNamespaceOffset {}
25 #[derive(Copy, Clone, Debug, PartialEq)]
26 
27 pub struct InParentNamespace<'a> {
28   pub _tab: flatbuffers::Table<'a>,
29 }
30 
31 impl<'a> flatbuffers::Follow<'a> for InParentNamespace<'a> {
32     type Inner = InParentNamespace<'a>;
33     #[inline]
follow(buf: &'a [u8], loc: usize) -> Self::Inner34     fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
35         Self {
36             _tab: flatbuffers::Table { buf: buf, loc: loc },
37         }
38     }
39 }
40 
41 impl<'a> InParentNamespace<'a> {
get_fully_qualified_name() -> &'static str42     pub const fn get_fully_qualified_name() -> &'static str {
43         "MyGame.InParentNamespace"
44     }
45 
46     #[inline]
init_from_table(table: flatbuffers::Table<'a>) -> Self47     pub fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
48         InParentNamespace {
49             _tab: table,
50         }
51     }
52     #[allow(unused_mut)]
create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>( _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>, _args: &'args InParentNamespaceArgs) -> flatbuffers::WIPOffset<InParentNamespace<'bldr>>53     pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>(
54         _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>,
55         _args: &'args InParentNamespaceArgs) -> flatbuffers::WIPOffset<InParentNamespace<'bldr>> {
56       let mut builder = InParentNamespaceBuilder::new(_fbb);
57       builder.finish()
58     }
59 
60 }
61 
62 pub struct InParentNamespaceArgs {
63 }
64 impl<'a> Default for InParentNamespaceArgs {
65     #[inline]
default() -> Self66     fn default() -> Self {
67         InParentNamespaceArgs {
68         }
69     }
70 }
71 pub struct InParentNamespaceBuilder<'a: 'b, 'b> {
72   fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a>,
73   start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
74 }
75 impl<'a: 'b, 'b> InParentNamespaceBuilder<'a, 'b> {
76   #[inline]
new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> InParentNamespaceBuilder<'a, 'b>77   pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> InParentNamespaceBuilder<'a, 'b> {
78     let start = _fbb.start_table();
79     InParentNamespaceBuilder {
80       fbb_: _fbb,
81       start_: start,
82     }
83   }
84   #[inline]
finish(self) -> flatbuffers::WIPOffset<InParentNamespace<'a>>85   pub fn finish(self) -> flatbuffers::WIPOffset<InParentNamespace<'a>> {
86     let o = self.fbb_.end_table(self.start_);
87     flatbuffers::WIPOffset::new(o.value())
88   }
89 }
90 
91 #[allow(unused_imports, dead_code)]
92 pub mod example_2 {
93 
94   use crate::include_test1_generated::*;
95   use crate::include_test2_generated::*;
96   use std::mem;
97   use std::cmp::Ordering;
98 
99   extern crate flatbuffers;
100   use self::flatbuffers::EndianScalar;
101 
102 pub enum MonsterOffset {}
103 #[derive(Copy, Clone, Debug, PartialEq)]
104 
105 pub struct Monster<'a> {
106   pub _tab: flatbuffers::Table<'a>,
107 }
108 
109 impl<'a> flatbuffers::Follow<'a> for Monster<'a> {
110     type Inner = Monster<'a>;
111     #[inline]
follow(buf: &'a [u8], loc: usize) -> Self::Inner112     fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
113         Self {
114             _tab: flatbuffers::Table { buf: buf, loc: loc },
115         }
116     }
117 }
118 
119 impl<'a> Monster<'a> {
get_fully_qualified_name() -> &'static str120     pub const fn get_fully_qualified_name() -> &'static str {
121         "MyGame.Example2.Monster"
122     }
123 
124     #[inline]
init_from_table(table: flatbuffers::Table<'a>) -> Self125     pub fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
126         Monster {
127             _tab: table,
128         }
129     }
130     #[allow(unused_mut)]
create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>( _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>, _args: &'args MonsterArgs) -> flatbuffers::WIPOffset<Monster<'bldr>>131     pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>(
132         _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>,
133         _args: &'args MonsterArgs) -> flatbuffers::WIPOffset<Monster<'bldr>> {
134       let mut builder = MonsterBuilder::new(_fbb);
135       builder.finish()
136     }
137 
138 }
139 
140 pub struct MonsterArgs {
141 }
142 impl<'a> Default for MonsterArgs {
143     #[inline]
default() -> Self144     fn default() -> Self {
145         MonsterArgs {
146         }
147     }
148 }
149 pub struct MonsterBuilder<'a: 'b, 'b> {
150   fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a>,
151   start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
152 }
153 impl<'a: 'b, 'b> MonsterBuilder<'a, 'b> {
154   #[inline]
new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> MonsterBuilder<'a, 'b>155   pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> MonsterBuilder<'a, 'b> {
156     let start = _fbb.start_table();
157     MonsterBuilder {
158       fbb_: _fbb,
159       start_: start,
160     }
161   }
162   #[inline]
finish(self) -> flatbuffers::WIPOffset<Monster<'a>>163   pub fn finish(self) -> flatbuffers::WIPOffset<Monster<'a>> {
164     let o = self.fbb_.end_table(self.start_);
165     flatbuffers::WIPOffset::new(o.value())
166   }
167 }
168 
169 }  // pub mod Example2
170 
171 #[allow(unused_imports, dead_code)]
172 pub mod example {
173 
174   use crate::include_test1_generated::*;
175   use crate::include_test2_generated::*;
176   use std::mem;
177   use std::cmp::Ordering;
178 
179   extern crate flatbuffers;
180   use self::flatbuffers::EndianScalar;
181 
182 /// Composite components of Monster color.
183 #[allow(non_camel_case_types)]
184 #[repr(u8)]
185 #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)]
186 pub enum Color {
187   Red = 1,
188   /// \brief color Green
189   /// Green is bit_flag with value (1u << 1)
190   Green = 2,
191   /// \brief color Blue (1u << 3)
192   Blue = 8,
193 
194 }
195 
196 pub const ENUM_MIN_COLOR: u8 = 1;
197 pub const ENUM_MAX_COLOR: u8 = 8;
198 
199 impl<'a> flatbuffers::Follow<'a> for Color {
200   type Inner = Self;
201   #[inline]
follow(buf: &'a [u8], loc: usize) -> Self::Inner202   fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
203     flatbuffers::read_scalar_at::<Self>(buf, loc)
204   }
205 }
206 
207 impl flatbuffers::EndianScalar for Color {
208   #[inline]
to_little_endian(self) -> Self209   fn to_little_endian(self) -> Self {
210     let n = u8::to_le(self as u8);
211     let p = &n as *const u8 as *const Color;
212     unsafe { *p }
213   }
214   #[inline]
from_little_endian(self) -> Self215   fn from_little_endian(self) -> Self {
216     let n = u8::from_le(self as u8);
217     let p = &n as *const u8 as *const Color;
218     unsafe { *p }
219   }
220 }
221 
222 impl flatbuffers::Push for Color {
223     type Output = Color;
224     #[inline]
push(&self, dst: &mut [u8], _rest: &[u8])225     fn push(&self, dst: &mut [u8], _rest: &[u8]) {
226         flatbuffers::emplace_scalar::<Color>(dst, *self);
227     }
228 }
229 
230 #[allow(non_camel_case_types)]
231 pub const ENUM_VALUES_COLOR:[Color; 3] = [
232   Color::Red,
233   Color::Green,
234   Color::Blue
235 ];
236 
237 #[allow(non_camel_case_types)]
238 pub const ENUM_NAMES_COLOR:[&'static str; 8] = [
239     "Red",
240     "Green",
241     "",
242     "",
243     "",
244     "",
245     "",
246     "Blue"
247 ];
248 
enum_name_color(e: Color) -> &'static str249 pub fn enum_name_color(e: Color) -> &'static str {
250   let index = e as u8 - Color::Red as u8;
251   ENUM_NAMES_COLOR[index as usize]
252 }
253 
254 #[allow(non_camel_case_types)]
255 #[repr(i8)]
256 #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)]
257 pub enum Race {
258   None = -1,
259   Human = 0,
260   Dwarf = 1,
261   Elf = 2,
262 
263 }
264 
265 pub const ENUM_MIN_RACE: i8 = -1;
266 pub const ENUM_MAX_RACE: i8 = 2;
267 
268 impl<'a> flatbuffers::Follow<'a> for Race {
269   type Inner = Self;
270   #[inline]
follow(buf: &'a [u8], loc: usize) -> Self::Inner271   fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
272     flatbuffers::read_scalar_at::<Self>(buf, loc)
273   }
274 }
275 
276 impl flatbuffers::EndianScalar for Race {
277   #[inline]
to_little_endian(self) -> Self278   fn to_little_endian(self) -> Self {
279     let n = i8::to_le(self as i8);
280     let p = &n as *const i8 as *const Race;
281     unsafe { *p }
282   }
283   #[inline]
from_little_endian(self) -> Self284   fn from_little_endian(self) -> Self {
285     let n = i8::from_le(self as i8);
286     let p = &n as *const i8 as *const Race;
287     unsafe { *p }
288   }
289 }
290 
291 impl flatbuffers::Push for Race {
292     type Output = Race;
293     #[inline]
push(&self, dst: &mut [u8], _rest: &[u8])294     fn push(&self, dst: &mut [u8], _rest: &[u8]) {
295         flatbuffers::emplace_scalar::<Race>(dst, *self);
296     }
297 }
298 
299 #[allow(non_camel_case_types)]
300 pub const ENUM_VALUES_RACE:[Race; 4] = [
301   Race::None,
302   Race::Human,
303   Race::Dwarf,
304   Race::Elf
305 ];
306 
307 #[allow(non_camel_case_types)]
308 pub const ENUM_NAMES_RACE:[&'static str; 4] = [
309     "None",
310     "Human",
311     "Dwarf",
312     "Elf"
313 ];
314 
enum_name_race(e: Race) -> &'static str315 pub fn enum_name_race(e: Race) -> &'static str {
316   let index = e as i8 - Race::None as i8;
317   ENUM_NAMES_RACE[index as usize]
318 }
319 
320 #[allow(non_camel_case_types)]
321 #[repr(u8)]
322 #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)]
323 pub enum Any {
324   NONE = 0,
325   Monster = 1,
326   TestSimpleTableWithEnum = 2,
327   MyGame_Example2_Monster = 3,
328 
329 }
330 
331 pub const ENUM_MIN_ANY: u8 = 0;
332 pub const ENUM_MAX_ANY: u8 = 3;
333 
334 impl<'a> flatbuffers::Follow<'a> for Any {
335   type Inner = Self;
336   #[inline]
follow(buf: &'a [u8], loc: usize) -> Self::Inner337   fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
338     flatbuffers::read_scalar_at::<Self>(buf, loc)
339   }
340 }
341 
342 impl flatbuffers::EndianScalar for Any {
343   #[inline]
to_little_endian(self) -> Self344   fn to_little_endian(self) -> Self {
345     let n = u8::to_le(self as u8);
346     let p = &n as *const u8 as *const Any;
347     unsafe { *p }
348   }
349   #[inline]
from_little_endian(self) -> Self350   fn from_little_endian(self) -> Self {
351     let n = u8::from_le(self as u8);
352     let p = &n as *const u8 as *const Any;
353     unsafe { *p }
354   }
355 }
356 
357 impl flatbuffers::Push for Any {
358     type Output = Any;
359     #[inline]
push(&self, dst: &mut [u8], _rest: &[u8])360     fn push(&self, dst: &mut [u8], _rest: &[u8]) {
361         flatbuffers::emplace_scalar::<Any>(dst, *self);
362     }
363 }
364 
365 #[allow(non_camel_case_types)]
366 pub const ENUM_VALUES_ANY:[Any; 4] = [
367   Any::NONE,
368   Any::Monster,
369   Any::TestSimpleTableWithEnum,
370   Any::MyGame_Example2_Monster
371 ];
372 
373 #[allow(non_camel_case_types)]
374 pub const ENUM_NAMES_ANY:[&'static str; 4] = [
375     "NONE",
376     "Monster",
377     "TestSimpleTableWithEnum",
378     "MyGame_Example2_Monster"
379 ];
380 
enum_name_any(e: Any) -> &'static str381 pub fn enum_name_any(e: Any) -> &'static str {
382   let index = e as u8;
383   ENUM_NAMES_ANY[index as usize]
384 }
385 
386 pub struct AnyUnionTableOffset {}
387 #[allow(non_camel_case_types)]
388 #[repr(u8)]
389 #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)]
390 pub enum AnyUniqueAliases {
391   NONE = 0,
392   M = 1,
393   TS = 2,
394   M2 = 3,
395 
396 }
397 
398 pub const ENUM_MIN_ANY_UNIQUE_ALIASES: u8 = 0;
399 pub const ENUM_MAX_ANY_UNIQUE_ALIASES: u8 = 3;
400 
401 impl<'a> flatbuffers::Follow<'a> for AnyUniqueAliases {
402   type Inner = Self;
403   #[inline]
follow(buf: &'a [u8], loc: usize) -> Self::Inner404   fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
405     flatbuffers::read_scalar_at::<Self>(buf, loc)
406   }
407 }
408 
409 impl flatbuffers::EndianScalar for AnyUniqueAliases {
410   #[inline]
to_little_endian(self) -> Self411   fn to_little_endian(self) -> Self {
412     let n = u8::to_le(self as u8);
413     let p = &n as *const u8 as *const AnyUniqueAliases;
414     unsafe { *p }
415   }
416   #[inline]
from_little_endian(self) -> Self417   fn from_little_endian(self) -> Self {
418     let n = u8::from_le(self as u8);
419     let p = &n as *const u8 as *const AnyUniqueAliases;
420     unsafe { *p }
421   }
422 }
423 
424 impl flatbuffers::Push for AnyUniqueAliases {
425     type Output = AnyUniqueAliases;
426     #[inline]
push(&self, dst: &mut [u8], _rest: &[u8])427     fn push(&self, dst: &mut [u8], _rest: &[u8]) {
428         flatbuffers::emplace_scalar::<AnyUniqueAliases>(dst, *self);
429     }
430 }
431 
432 #[allow(non_camel_case_types)]
433 pub const ENUM_VALUES_ANY_UNIQUE_ALIASES:[AnyUniqueAliases; 4] = [
434   AnyUniqueAliases::NONE,
435   AnyUniqueAliases::M,
436   AnyUniqueAliases::TS,
437   AnyUniqueAliases::M2
438 ];
439 
440 #[allow(non_camel_case_types)]
441 pub const ENUM_NAMES_ANY_UNIQUE_ALIASES:[&'static str; 4] = [
442     "NONE",
443     "M",
444     "TS",
445     "M2"
446 ];
447 
enum_name_any_unique_aliases(e: AnyUniqueAliases) -> &'static str448 pub fn enum_name_any_unique_aliases(e: AnyUniqueAliases) -> &'static str {
449   let index = e as u8;
450   ENUM_NAMES_ANY_UNIQUE_ALIASES[index as usize]
451 }
452 
453 pub struct AnyUniqueAliasesUnionTableOffset {}
454 #[allow(non_camel_case_types)]
455 #[repr(u8)]
456 #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)]
457 pub enum AnyAmbiguousAliases {
458   NONE = 0,
459   M1 = 1,
460   M2 = 2,
461   M3 = 3,
462 
463 }
464 
465 pub const ENUM_MIN_ANY_AMBIGUOUS_ALIASES: u8 = 0;
466 pub const ENUM_MAX_ANY_AMBIGUOUS_ALIASES: u8 = 3;
467 
468 impl<'a> flatbuffers::Follow<'a> for AnyAmbiguousAliases {
469   type Inner = Self;
470   #[inline]
follow(buf: &'a [u8], loc: usize) -> Self::Inner471   fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
472     flatbuffers::read_scalar_at::<Self>(buf, loc)
473   }
474 }
475 
476 impl flatbuffers::EndianScalar for AnyAmbiguousAliases {
477   #[inline]
to_little_endian(self) -> Self478   fn to_little_endian(self) -> Self {
479     let n = u8::to_le(self as u8);
480     let p = &n as *const u8 as *const AnyAmbiguousAliases;
481     unsafe { *p }
482   }
483   #[inline]
from_little_endian(self) -> Self484   fn from_little_endian(self) -> Self {
485     let n = u8::from_le(self as u8);
486     let p = &n as *const u8 as *const AnyAmbiguousAliases;
487     unsafe { *p }
488   }
489 }
490 
491 impl flatbuffers::Push for AnyAmbiguousAliases {
492     type Output = AnyAmbiguousAliases;
493     #[inline]
push(&self, dst: &mut [u8], _rest: &[u8])494     fn push(&self, dst: &mut [u8], _rest: &[u8]) {
495         flatbuffers::emplace_scalar::<AnyAmbiguousAliases>(dst, *self);
496     }
497 }
498 
499 #[allow(non_camel_case_types)]
500 pub const ENUM_VALUES_ANY_AMBIGUOUS_ALIASES:[AnyAmbiguousAliases; 4] = [
501   AnyAmbiguousAliases::NONE,
502   AnyAmbiguousAliases::M1,
503   AnyAmbiguousAliases::M2,
504   AnyAmbiguousAliases::M3
505 ];
506 
507 #[allow(non_camel_case_types)]
508 pub const ENUM_NAMES_ANY_AMBIGUOUS_ALIASES:[&'static str; 4] = [
509     "NONE",
510     "M1",
511     "M2",
512     "M3"
513 ];
514 
enum_name_any_ambiguous_aliases(e: AnyAmbiguousAliases) -> &'static str515 pub fn enum_name_any_ambiguous_aliases(e: AnyAmbiguousAliases) -> &'static str {
516   let index = e as u8;
517   ENUM_NAMES_ANY_AMBIGUOUS_ALIASES[index as usize]
518 }
519 
520 pub struct AnyAmbiguousAliasesUnionTableOffset {}
521 // struct Test, aligned to 2
522 #[repr(C, align(2))]
523 #[derive(Clone, Copy, Debug, PartialEq)]
524 pub struct Test {
525   a_: i16,
526   b_: i8,
527   padding0__: u8,
528 } // pub struct Test
529 impl flatbuffers::SafeSliceAccess for Test {}
530 impl<'a> flatbuffers::Follow<'a> for Test {
531   type Inner = &'a Test;
532   #[inline]
follow(buf: &'a [u8], loc: usize) -> Self::Inner533   fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
534     <&'a Test>::follow(buf, loc)
535   }
536 }
537 impl<'a> flatbuffers::Follow<'a> for &'a Test {
538   type Inner = &'a Test;
539   #[inline]
follow(buf: &'a [u8], loc: usize) -> Self::Inner540   fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
541     flatbuffers::follow_cast_ref::<Test>(buf, loc)
542   }
543 }
544 impl<'b> flatbuffers::Push for Test {
545     type Output = Test;
546     #[inline]
push(&self, dst: &mut [u8], _rest: &[u8])547     fn push(&self, dst: &mut [u8], _rest: &[u8]) {
548         let src = unsafe {
549             ::std::slice::from_raw_parts(self as *const Test as *const u8, Self::size())
550         };
551         dst.copy_from_slice(src);
552     }
553 }
554 impl<'b> flatbuffers::Push for &'b Test {
555     type Output = Test;
556 
557     #[inline]
push(&self, dst: &mut [u8], _rest: &[u8])558     fn push(&self, dst: &mut [u8], _rest: &[u8]) {
559         let src = unsafe {
560             ::std::slice::from_raw_parts(*self as *const Test as *const u8, Self::size())
561         };
562         dst.copy_from_slice(src);
563     }
564 }
565 
566 
567 impl Test {
new<'a>(_a: i16, _b: i8) -> Self568   pub fn new<'a>(_a: i16, _b: i8) -> Self {
569     Test {
570       a_: _a.to_little_endian(),
571       b_: _b.to_little_endian(),
572 
573       padding0__: 0,
574     }
575   }
get_fully_qualified_name() -> &'static str576     pub const fn get_fully_qualified_name() -> &'static str {
577         "MyGame.Example.Test"
578     }
579 
a<'a>(&'a self) -> i16580   pub fn a<'a>(&'a self) -> i16 {
581     self.a_.from_little_endian()
582   }
b<'a>(&'a self) -> i8583   pub fn b<'a>(&'a self) -> i8 {
584     self.b_.from_little_endian()
585   }
586 }
587 
588 // struct Vec3, aligned to 8
589 #[repr(C, align(8))]
590 #[derive(Clone, Copy, Debug, PartialEq)]
591 pub struct Vec3 {
592   x_: f32,
593   y_: f32,
594   z_: f32,
595   padding0__: u32,
596   test1_: f64,
597   test2_: Color,
598   padding1__: u8,
599   test3_: Test,
600   padding2__: u16,
601 } // pub struct Vec3
602 impl flatbuffers::SafeSliceAccess for Vec3 {}
603 impl<'a> flatbuffers::Follow<'a> for Vec3 {
604   type Inner = &'a Vec3;
605   #[inline]
follow(buf: &'a [u8], loc: usize) -> Self::Inner606   fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
607     <&'a Vec3>::follow(buf, loc)
608   }
609 }
610 impl<'a> flatbuffers::Follow<'a> for &'a Vec3 {
611   type Inner = &'a Vec3;
612   #[inline]
follow(buf: &'a [u8], loc: usize) -> Self::Inner613   fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
614     flatbuffers::follow_cast_ref::<Vec3>(buf, loc)
615   }
616 }
617 impl<'b> flatbuffers::Push for Vec3 {
618     type Output = Vec3;
619     #[inline]
push(&self, dst: &mut [u8], _rest: &[u8])620     fn push(&self, dst: &mut [u8], _rest: &[u8]) {
621         let src = unsafe {
622             ::std::slice::from_raw_parts(self as *const Vec3 as *const u8, Self::size())
623         };
624         dst.copy_from_slice(src);
625     }
626 }
627 impl<'b> flatbuffers::Push for &'b Vec3 {
628     type Output = Vec3;
629 
630     #[inline]
push(&self, dst: &mut [u8], _rest: &[u8])631     fn push(&self, dst: &mut [u8], _rest: &[u8]) {
632         let src = unsafe {
633             ::std::slice::from_raw_parts(*self as *const Vec3 as *const u8, Self::size())
634         };
635         dst.copy_from_slice(src);
636     }
637 }
638 
639 
640 impl Vec3 {
new<'a>(_x: f32, _y: f32, _z: f32, _test1: f64, _test2: Color, _test3: &'a Test) -> Self641   pub fn new<'a>(_x: f32, _y: f32, _z: f32, _test1: f64, _test2: Color, _test3: &'a Test) -> Self {
642     Vec3 {
643       x_: _x.to_little_endian(),
644       y_: _y.to_little_endian(),
645       z_: _z.to_little_endian(),
646       test1_: _test1.to_little_endian(),
647       test2_: _test2.to_little_endian(),
648       test3_: *_test3,
649 
650       padding0__: 0,
651       padding1__: 0,
652       padding2__: 0,
653     }
654   }
get_fully_qualified_name() -> &'static str655     pub const fn get_fully_qualified_name() -> &'static str {
656         "MyGame.Example.Vec3"
657     }
658 
x<'a>(&'a self) -> f32659   pub fn x<'a>(&'a self) -> f32 {
660     self.x_.from_little_endian()
661   }
y<'a>(&'a self) -> f32662   pub fn y<'a>(&'a self) -> f32 {
663     self.y_.from_little_endian()
664   }
z<'a>(&'a self) -> f32665   pub fn z<'a>(&'a self) -> f32 {
666     self.z_.from_little_endian()
667   }
test1<'a>(&'a self) -> f64668   pub fn test1<'a>(&'a self) -> f64 {
669     self.test1_.from_little_endian()
670   }
test2<'a>(&'a self) -> Color671   pub fn test2<'a>(&'a self) -> Color {
672     self.test2_.from_little_endian()
673   }
test3<'a>(&'a self) -> &'a Test674   pub fn test3<'a>(&'a self) -> &'a Test {
675     &self.test3_
676   }
677 }
678 
679 // struct Ability, aligned to 4
680 #[repr(C, align(4))]
681 #[derive(Clone, Copy, Debug, PartialEq)]
682 pub struct Ability {
683   id_: u32,
684   distance_: u32,
685 } // pub struct Ability
686 impl flatbuffers::SafeSliceAccess for Ability {}
687 impl<'a> flatbuffers::Follow<'a> for Ability {
688   type Inner = &'a Ability;
689   #[inline]
follow(buf: &'a [u8], loc: usize) -> Self::Inner690   fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
691     <&'a Ability>::follow(buf, loc)
692   }
693 }
694 impl<'a> flatbuffers::Follow<'a> for &'a Ability {
695   type Inner = &'a Ability;
696   #[inline]
follow(buf: &'a [u8], loc: usize) -> Self::Inner697   fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
698     flatbuffers::follow_cast_ref::<Ability>(buf, loc)
699   }
700 }
701 impl<'b> flatbuffers::Push for Ability {
702     type Output = Ability;
703     #[inline]
push(&self, dst: &mut [u8], _rest: &[u8])704     fn push(&self, dst: &mut [u8], _rest: &[u8]) {
705         let src = unsafe {
706             ::std::slice::from_raw_parts(self as *const Ability as *const u8, Self::size())
707         };
708         dst.copy_from_slice(src);
709     }
710 }
711 impl<'b> flatbuffers::Push for &'b Ability {
712     type Output = Ability;
713 
714     #[inline]
push(&self, dst: &mut [u8], _rest: &[u8])715     fn push(&self, dst: &mut [u8], _rest: &[u8]) {
716         let src = unsafe {
717             ::std::slice::from_raw_parts(*self as *const Ability as *const u8, Self::size())
718         };
719         dst.copy_from_slice(src);
720     }
721 }
722 
723 
724 impl Ability {
new<'a>(_id: u32, _distance: u32) -> Self725   pub fn new<'a>(_id: u32, _distance: u32) -> Self {
726     Ability {
727       id_: _id.to_little_endian(),
728       distance_: _distance.to_little_endian(),
729 
730     }
731   }
get_fully_qualified_name() -> &'static str732     pub const fn get_fully_qualified_name() -> &'static str {
733         "MyGame.Example.Ability"
734     }
735 
id<'a>(&'a self) -> u32736   pub fn id<'a>(&'a self) -> u32 {
737     self.id_.from_little_endian()
738   }
739   #[inline]
key_compare_less_than(&self, o: &Ability) -> bool740   pub fn key_compare_less_than(&self, o: &Ability) ->  bool {
741     self.id() < o.id()
742   }
743 
744   #[inline]
key_compare_with_value(&self, val: u32) -> ::std::cmp::Ordering745   pub fn key_compare_with_value(&self, val: u32) ->  ::std::cmp::Ordering {
746     let key = self.id();
747     key.cmp(&val)
748   }
distance<'a>(&'a self) -> u32749   pub fn distance<'a>(&'a self) -> u32 {
750     self.distance_.from_little_endian()
751   }
752 }
753 
754 pub enum TestSimpleTableWithEnumOffset {}
755 #[derive(Copy, Clone, Debug, PartialEq)]
756 
757 pub struct TestSimpleTableWithEnum<'a> {
758   pub _tab: flatbuffers::Table<'a>,
759 }
760 
761 impl<'a> flatbuffers::Follow<'a> for TestSimpleTableWithEnum<'a> {
762     type Inner = TestSimpleTableWithEnum<'a>;
763     #[inline]
follow(buf: &'a [u8], loc: usize) -> Self::Inner764     fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
765         Self {
766             _tab: flatbuffers::Table { buf: buf, loc: loc },
767         }
768     }
769 }
770 
771 impl<'a> TestSimpleTableWithEnum<'a> {
get_fully_qualified_name() -> &'static str772     pub const fn get_fully_qualified_name() -> &'static str {
773         "MyGame.Example.TestSimpleTableWithEnum"
774     }
775 
776     #[inline]
init_from_table(table: flatbuffers::Table<'a>) -> Self777     pub fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
778         TestSimpleTableWithEnum {
779             _tab: table,
780         }
781     }
782     #[allow(unused_mut)]
create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>( _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>, args: &'args TestSimpleTableWithEnumArgs) -> flatbuffers::WIPOffset<TestSimpleTableWithEnum<'bldr>>783     pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>(
784         _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>,
785         args: &'args TestSimpleTableWithEnumArgs) -> flatbuffers::WIPOffset<TestSimpleTableWithEnum<'bldr>> {
786       let mut builder = TestSimpleTableWithEnumBuilder::new(_fbb);
787       builder.add_color(args.color);
788       builder.finish()
789     }
790 
791     pub const VT_COLOR: flatbuffers::VOffsetT = 4;
792 
793   #[inline]
color(&self) -> Color794   pub fn color(&self) -> Color {
795     self._tab.get::<Color>(TestSimpleTableWithEnum::VT_COLOR, Some(Color::Green)).unwrap()
796   }
797 }
798 
799 pub struct TestSimpleTableWithEnumArgs {
800     pub color: Color,
801 }
802 impl<'a> Default for TestSimpleTableWithEnumArgs {
803     #[inline]
default() -> Self804     fn default() -> Self {
805         TestSimpleTableWithEnumArgs {
806             color: Color::Green,
807         }
808     }
809 }
810 pub struct TestSimpleTableWithEnumBuilder<'a: 'b, 'b> {
811   fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a>,
812   start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
813 }
814 impl<'a: 'b, 'b> TestSimpleTableWithEnumBuilder<'a, 'b> {
815   #[inline]
add_color(&mut self, color: Color)816   pub fn add_color(&mut self, color: Color) {
817     self.fbb_.push_slot::<Color>(TestSimpleTableWithEnum::VT_COLOR, color, Color::Green);
818   }
819   #[inline]
new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> TestSimpleTableWithEnumBuilder<'a, 'b>820   pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> TestSimpleTableWithEnumBuilder<'a, 'b> {
821     let start = _fbb.start_table();
822     TestSimpleTableWithEnumBuilder {
823       fbb_: _fbb,
824       start_: start,
825     }
826   }
827   #[inline]
finish(self) -> flatbuffers::WIPOffset<TestSimpleTableWithEnum<'a>>828   pub fn finish(self) -> flatbuffers::WIPOffset<TestSimpleTableWithEnum<'a>> {
829     let o = self.fbb_.end_table(self.start_);
830     flatbuffers::WIPOffset::new(o.value())
831   }
832 }
833 
834 pub enum StatOffset {}
835 #[derive(Copy, Clone, Debug, PartialEq)]
836 
837 pub struct Stat<'a> {
838   pub _tab: flatbuffers::Table<'a>,
839 }
840 
841 impl<'a> flatbuffers::Follow<'a> for Stat<'a> {
842     type Inner = Stat<'a>;
843     #[inline]
follow(buf: &'a [u8], loc: usize) -> Self::Inner844     fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
845         Self {
846             _tab: flatbuffers::Table { buf: buf, loc: loc },
847         }
848     }
849 }
850 
851 impl<'a> Stat<'a> {
get_fully_qualified_name() -> &'static str852     pub const fn get_fully_qualified_name() -> &'static str {
853         "MyGame.Example.Stat"
854     }
855 
856     #[inline]
init_from_table(table: flatbuffers::Table<'a>) -> Self857     pub fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
858         Stat {
859             _tab: table,
860         }
861     }
862     #[allow(unused_mut)]
create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>( _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>, args: &'args StatArgs<'args>) -> flatbuffers::WIPOffset<Stat<'bldr>>863     pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>(
864         _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>,
865         args: &'args StatArgs<'args>) -> flatbuffers::WIPOffset<Stat<'bldr>> {
866       let mut builder = StatBuilder::new(_fbb);
867       builder.add_val(args.val);
868       if let Some(x) = args.id { builder.add_id(x); }
869       builder.add_count(args.count);
870       builder.finish()
871     }
872 
873     pub const VT_ID: flatbuffers::VOffsetT = 4;
874     pub const VT_VAL: flatbuffers::VOffsetT = 6;
875     pub const VT_COUNT: flatbuffers::VOffsetT = 8;
876 
877   #[inline]
id(&self) -> Option<&'a str>878   pub fn id(&self) -> Option<&'a str> {
879     self._tab.get::<flatbuffers::ForwardsUOffset<&str>>(Stat::VT_ID, None)
880   }
881   #[inline]
val(&self) -> i64882   pub fn val(&self) -> i64 {
883     self._tab.get::<i64>(Stat::VT_VAL, Some(0)).unwrap()
884   }
885   #[inline]
count(&self) -> u16886   pub fn count(&self) -> u16 {
887     self._tab.get::<u16>(Stat::VT_COUNT, Some(0)).unwrap()
888   }
889 }
890 
891 pub struct StatArgs<'a> {
892     pub id: Option<flatbuffers::WIPOffset<&'a  str>>,
893     pub val: i64,
894     pub count: u16,
895 }
896 impl<'a> Default for StatArgs<'a> {
897     #[inline]
default() -> Self898     fn default() -> Self {
899         StatArgs {
900             id: None,
901             val: 0,
902             count: 0,
903         }
904     }
905 }
906 pub struct StatBuilder<'a: 'b, 'b> {
907   fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a>,
908   start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
909 }
910 impl<'a: 'b, 'b> StatBuilder<'a, 'b> {
911   #[inline]
add_id(&mut self, id: flatbuffers::WIPOffset<&'b str>)912   pub fn add_id(&mut self, id: flatbuffers::WIPOffset<&'b  str>) {
913     self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Stat::VT_ID, id);
914   }
915   #[inline]
add_val(&mut self, val: i64)916   pub fn add_val(&mut self, val: i64) {
917     self.fbb_.push_slot::<i64>(Stat::VT_VAL, val, 0);
918   }
919   #[inline]
add_count(&mut self, count: u16)920   pub fn add_count(&mut self, count: u16) {
921     self.fbb_.push_slot::<u16>(Stat::VT_COUNT, count, 0);
922   }
923   #[inline]
new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> StatBuilder<'a, 'b>924   pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> StatBuilder<'a, 'b> {
925     let start = _fbb.start_table();
926     StatBuilder {
927       fbb_: _fbb,
928       start_: start,
929     }
930   }
931   #[inline]
finish(self) -> flatbuffers::WIPOffset<Stat<'a>>932   pub fn finish(self) -> flatbuffers::WIPOffset<Stat<'a>> {
933     let o = self.fbb_.end_table(self.start_);
934     flatbuffers::WIPOffset::new(o.value())
935   }
936 }
937 
938 pub enum ReferrableOffset {}
939 #[derive(Copy, Clone, Debug, PartialEq)]
940 
941 pub struct Referrable<'a> {
942   pub _tab: flatbuffers::Table<'a>,
943 }
944 
945 impl<'a> flatbuffers::Follow<'a> for Referrable<'a> {
946     type Inner = Referrable<'a>;
947     #[inline]
follow(buf: &'a [u8], loc: usize) -> Self::Inner948     fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
949         Self {
950             _tab: flatbuffers::Table { buf: buf, loc: loc },
951         }
952     }
953 }
954 
955 impl<'a> Referrable<'a> {
get_fully_qualified_name() -> &'static str956     pub const fn get_fully_qualified_name() -> &'static str {
957         "MyGame.Example.Referrable"
958     }
959 
960     #[inline]
init_from_table(table: flatbuffers::Table<'a>) -> Self961     pub fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
962         Referrable {
963             _tab: table,
964         }
965     }
966     #[allow(unused_mut)]
create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>( _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>, args: &'args ReferrableArgs) -> flatbuffers::WIPOffset<Referrable<'bldr>>967     pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>(
968         _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>,
969         args: &'args ReferrableArgs) -> flatbuffers::WIPOffset<Referrable<'bldr>> {
970       let mut builder = ReferrableBuilder::new(_fbb);
971       builder.add_id(args.id);
972       builder.finish()
973     }
974 
975     pub const VT_ID: flatbuffers::VOffsetT = 4;
976 
977   #[inline]
id(&self) -> u64978   pub fn id(&self) -> u64 {
979     self._tab.get::<u64>(Referrable::VT_ID, Some(0)).unwrap()
980   }
981   #[inline]
key_compare_less_than(&self, o: &Referrable) -> bool982   pub fn key_compare_less_than(&self, o: &Referrable) ->  bool {
983     self.id() < o.id()
984   }
985 
986   #[inline]
key_compare_with_value(&self, val: u64) -> ::std::cmp::Ordering987   pub fn key_compare_with_value(&self, val: u64) ->  ::std::cmp::Ordering {
988     let key = self.id();
989     key.cmp(&val)
990   }
991 }
992 
993 pub struct ReferrableArgs {
994     pub id: u64,
995 }
996 impl<'a> Default for ReferrableArgs {
997     #[inline]
default() -> Self998     fn default() -> Self {
999         ReferrableArgs {
1000             id: 0,
1001         }
1002     }
1003 }
1004 pub struct ReferrableBuilder<'a: 'b, 'b> {
1005   fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a>,
1006   start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
1007 }
1008 impl<'a: 'b, 'b> ReferrableBuilder<'a, 'b> {
1009   #[inline]
add_id(&mut self, id: u64)1010   pub fn add_id(&mut self, id: u64) {
1011     self.fbb_.push_slot::<u64>(Referrable::VT_ID, id, 0);
1012   }
1013   #[inline]
new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> ReferrableBuilder<'a, 'b>1014   pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> ReferrableBuilder<'a, 'b> {
1015     let start = _fbb.start_table();
1016     ReferrableBuilder {
1017       fbb_: _fbb,
1018       start_: start,
1019     }
1020   }
1021   #[inline]
finish(self) -> flatbuffers::WIPOffset<Referrable<'a>>1022   pub fn finish(self) -> flatbuffers::WIPOffset<Referrable<'a>> {
1023     let o = self.fbb_.end_table(self.start_);
1024     flatbuffers::WIPOffset::new(o.value())
1025   }
1026 }
1027 
1028 pub enum MonsterOffset {}
1029 #[derive(Copy, Clone, Debug, PartialEq)]
1030 
1031 /// an example documentation comment: "monster object"
1032 pub struct Monster<'a> {
1033   pub _tab: flatbuffers::Table<'a>,
1034 }
1035 
1036 impl<'a> flatbuffers::Follow<'a> for Monster<'a> {
1037     type Inner = Monster<'a>;
1038     #[inline]
follow(buf: &'a [u8], loc: usize) -> Self::Inner1039     fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
1040         Self {
1041             _tab: flatbuffers::Table { buf: buf, loc: loc },
1042         }
1043     }
1044 }
1045 
1046 impl<'a> Monster<'a> {
get_fully_qualified_name() -> &'static str1047     pub const fn get_fully_qualified_name() -> &'static str {
1048         "MyGame.Example.Monster"
1049     }
1050 
1051     #[inline]
init_from_table(table: flatbuffers::Table<'a>) -> Self1052     pub fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
1053         Monster {
1054             _tab: table,
1055         }
1056     }
1057     #[allow(unused_mut)]
create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>( _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>, args: &'args MonsterArgs<'args>) -> flatbuffers::WIPOffset<Monster<'bldr>>1058     pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>(
1059         _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>,
1060         args: &'args MonsterArgs<'args>) -> flatbuffers::WIPOffset<Monster<'bldr>> {
1061       let mut builder = MonsterBuilder::new(_fbb);
1062       builder.add_non_owning_reference(args.non_owning_reference);
1063       builder.add_co_owning_reference(args.co_owning_reference);
1064       builder.add_single_weak_reference(args.single_weak_reference);
1065       builder.add_testhashu64_fnv1a(args.testhashu64_fnv1a);
1066       builder.add_testhashs64_fnv1a(args.testhashs64_fnv1a);
1067       builder.add_testhashu64_fnv1(args.testhashu64_fnv1);
1068       builder.add_testhashs64_fnv1(args.testhashs64_fnv1);
1069       if let Some(x) = args.vector_of_enums { builder.add_vector_of_enums(x); }
1070       if let Some(x) = args.any_ambiguous { builder.add_any_ambiguous(x); }
1071       if let Some(x) = args.any_unique { builder.add_any_unique(x); }
1072       if let Some(x) = args.vector_of_non_owning_references { builder.add_vector_of_non_owning_references(x); }
1073       if let Some(x) = args.vector_of_co_owning_references { builder.add_vector_of_co_owning_references(x); }
1074       if let Some(x) = args.vector_of_strong_referrables { builder.add_vector_of_strong_referrables(x); }
1075       if let Some(x) = args.vector_of_weak_references { builder.add_vector_of_weak_references(x); }
1076       if let Some(x) = args.vector_of_referrables { builder.add_vector_of_referrables(x); }
1077       if let Some(x) = args.parent_namespace_test { builder.add_parent_namespace_test(x); }
1078       if let Some(x) = args.vector_of_doubles { builder.add_vector_of_doubles(x); }
1079       if let Some(x) = args.vector_of_longs { builder.add_vector_of_longs(x); }
1080       if let Some(x) = args.test5 { builder.add_test5(x); }
1081       if let Some(x) = args.flex { builder.add_flex(x); }
1082       if let Some(x) = args.testarrayofsortedstruct { builder.add_testarrayofsortedstruct(x); }
1083       if let Some(x) = args.testarrayofstring2 { builder.add_testarrayofstring2(x); }
1084       builder.add_testf3(args.testf3);
1085       builder.add_testf2(args.testf2);
1086       builder.add_testf(args.testf);
1087       if let Some(x) = args.testarrayofbools { builder.add_testarrayofbools(x); }
1088       builder.add_testhashu32_fnv1a(args.testhashu32_fnv1a);
1089       builder.add_testhashs32_fnv1a(args.testhashs32_fnv1a);
1090       builder.add_testhashu32_fnv1(args.testhashu32_fnv1);
1091       builder.add_testhashs32_fnv1(args.testhashs32_fnv1);
1092       if let Some(x) = args.testempty { builder.add_testempty(x); }
1093       if let Some(x) = args.testnestedflatbuffer { builder.add_testnestedflatbuffer(x); }
1094       if let Some(x) = args.enemy { builder.add_enemy(x); }
1095       if let Some(x) = args.testarrayoftables { builder.add_testarrayoftables(x); }
1096       if let Some(x) = args.testarrayofstring { builder.add_testarrayofstring(x); }
1097       if let Some(x) = args.test4 { builder.add_test4(x); }
1098       if let Some(x) = args.test { builder.add_test(x); }
1099       if let Some(x) = args.inventory { builder.add_inventory(x); }
1100       if let Some(x) = args.name { builder.add_name(x); }
1101       if let Some(x) = args.pos { builder.add_pos(x); }
1102       builder.add_hp(args.hp);
1103       builder.add_mana(args.mana);
1104       builder.add_signed_enum(args.signed_enum);
1105       builder.add_any_ambiguous_type(args.any_ambiguous_type);
1106       builder.add_any_unique_type(args.any_unique_type);
1107       builder.add_testbool(args.testbool);
1108       builder.add_test_type(args.test_type);
1109       builder.add_color(args.color);
1110       builder.finish()
1111     }
1112 
1113     pub const VT_POS: flatbuffers::VOffsetT = 4;
1114     pub const VT_MANA: flatbuffers::VOffsetT = 6;
1115     pub const VT_HP: flatbuffers::VOffsetT = 8;
1116     pub const VT_NAME: flatbuffers::VOffsetT = 10;
1117     pub const VT_INVENTORY: flatbuffers::VOffsetT = 14;
1118     pub const VT_COLOR: flatbuffers::VOffsetT = 16;
1119     pub const VT_TEST_TYPE: flatbuffers::VOffsetT = 18;
1120     pub const VT_TEST: flatbuffers::VOffsetT = 20;
1121     pub const VT_TEST4: flatbuffers::VOffsetT = 22;
1122     pub const VT_TESTARRAYOFSTRING: flatbuffers::VOffsetT = 24;
1123     pub const VT_TESTARRAYOFTABLES: flatbuffers::VOffsetT = 26;
1124     pub const VT_ENEMY: flatbuffers::VOffsetT = 28;
1125     pub const VT_TESTNESTEDFLATBUFFER: flatbuffers::VOffsetT = 30;
1126     pub const VT_TESTEMPTY: flatbuffers::VOffsetT = 32;
1127     pub const VT_TESTBOOL: flatbuffers::VOffsetT = 34;
1128     pub const VT_TESTHASHS32_FNV1: flatbuffers::VOffsetT = 36;
1129     pub const VT_TESTHASHU32_FNV1: flatbuffers::VOffsetT = 38;
1130     pub const VT_TESTHASHS64_FNV1: flatbuffers::VOffsetT = 40;
1131     pub const VT_TESTHASHU64_FNV1: flatbuffers::VOffsetT = 42;
1132     pub const VT_TESTHASHS32_FNV1A: flatbuffers::VOffsetT = 44;
1133     pub const VT_TESTHASHU32_FNV1A: flatbuffers::VOffsetT = 46;
1134     pub const VT_TESTHASHS64_FNV1A: flatbuffers::VOffsetT = 48;
1135     pub const VT_TESTHASHU64_FNV1A: flatbuffers::VOffsetT = 50;
1136     pub const VT_TESTARRAYOFBOOLS: flatbuffers::VOffsetT = 52;
1137     pub const VT_TESTF: flatbuffers::VOffsetT = 54;
1138     pub const VT_TESTF2: flatbuffers::VOffsetT = 56;
1139     pub const VT_TESTF3: flatbuffers::VOffsetT = 58;
1140     pub const VT_TESTARRAYOFSTRING2: flatbuffers::VOffsetT = 60;
1141     pub const VT_TESTARRAYOFSORTEDSTRUCT: flatbuffers::VOffsetT = 62;
1142     pub const VT_FLEX: flatbuffers::VOffsetT = 64;
1143     pub const VT_TEST5: flatbuffers::VOffsetT = 66;
1144     pub const VT_VECTOR_OF_LONGS: flatbuffers::VOffsetT = 68;
1145     pub const VT_VECTOR_OF_DOUBLES: flatbuffers::VOffsetT = 70;
1146     pub const VT_PARENT_NAMESPACE_TEST: flatbuffers::VOffsetT = 72;
1147     pub const VT_VECTOR_OF_REFERRABLES: flatbuffers::VOffsetT = 74;
1148     pub const VT_SINGLE_WEAK_REFERENCE: flatbuffers::VOffsetT = 76;
1149     pub const VT_VECTOR_OF_WEAK_REFERENCES: flatbuffers::VOffsetT = 78;
1150     pub const VT_VECTOR_OF_STRONG_REFERRABLES: flatbuffers::VOffsetT = 80;
1151     pub const VT_CO_OWNING_REFERENCE: flatbuffers::VOffsetT = 82;
1152     pub const VT_VECTOR_OF_CO_OWNING_REFERENCES: flatbuffers::VOffsetT = 84;
1153     pub const VT_NON_OWNING_REFERENCE: flatbuffers::VOffsetT = 86;
1154     pub const VT_VECTOR_OF_NON_OWNING_REFERENCES: flatbuffers::VOffsetT = 88;
1155     pub const VT_ANY_UNIQUE_TYPE: flatbuffers::VOffsetT = 90;
1156     pub const VT_ANY_UNIQUE: flatbuffers::VOffsetT = 92;
1157     pub const VT_ANY_AMBIGUOUS_TYPE: flatbuffers::VOffsetT = 94;
1158     pub const VT_ANY_AMBIGUOUS: flatbuffers::VOffsetT = 96;
1159     pub const VT_VECTOR_OF_ENUMS: flatbuffers::VOffsetT = 98;
1160     pub const VT_SIGNED_ENUM: flatbuffers::VOffsetT = 100;
1161 
1162   #[inline]
pos(&self) -> Option<&'a Vec3>1163   pub fn pos(&self) -> Option<&'a Vec3> {
1164     self._tab.get::<Vec3>(Monster::VT_POS, None)
1165   }
1166   #[inline]
mana(&self) -> i161167   pub fn mana(&self) -> i16 {
1168     self._tab.get::<i16>(Monster::VT_MANA, Some(150)).unwrap()
1169   }
1170   #[inline]
hp(&self) -> i161171   pub fn hp(&self) -> i16 {
1172     self._tab.get::<i16>(Monster::VT_HP, Some(100)).unwrap()
1173   }
1174   #[inline]
name(&self) -> &'a str1175   pub fn name(&self) -> &'a str {
1176     self._tab.get::<flatbuffers::ForwardsUOffset<&str>>(Monster::VT_NAME, None).unwrap()
1177   }
1178   #[inline]
key_compare_less_than(&self, o: &Monster) -> bool1179   pub fn key_compare_less_than(&self, o: &Monster) ->  bool {
1180     self.name() < o.name()
1181   }
1182 
1183   #[inline]
key_compare_with_value(&self, val: & str) -> ::std::cmp::Ordering1184   pub fn key_compare_with_value(&self, val: & str) ->  ::std::cmp::Ordering {
1185     let key = self.name();
1186     key.cmp(&val)
1187   }
1188   #[inline]
inventory(&self) -> Option<&'a [u8]>1189   pub fn inventory(&self) -> Option<&'a [u8]> {
1190     self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, u8>>>(Monster::VT_INVENTORY, None).map(|v| v.safe_slice())
1191   }
1192   #[inline]
color(&self) -> Color1193   pub fn color(&self) -> Color {
1194     self._tab.get::<Color>(Monster::VT_COLOR, Some(Color::Blue)).unwrap()
1195   }
1196   #[inline]
test_type(&self) -> Any1197   pub fn test_type(&self) -> Any {
1198     self._tab.get::<Any>(Monster::VT_TEST_TYPE, Some(Any::NONE)).unwrap()
1199   }
1200   #[inline]
test(&self) -> Option<flatbuffers::Table<'a>>1201   pub fn test(&self) -> Option<flatbuffers::Table<'a>> {
1202     self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Table<'a>>>(Monster::VT_TEST, None)
1203   }
1204   #[inline]
test4(&self) -> Option<&'a [Test]>1205   pub fn test4(&self) -> Option<&'a [Test]> {
1206     self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<Test>>>(Monster::VT_TEST4, None).map(|v| v.safe_slice() )
1207   }
1208   #[inline]
testarrayofstring(&self) -> Option<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<&'a str>>>1209   pub fn testarrayofstring(&self) -> Option<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<&'a str>>> {
1210     self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<flatbuffers::ForwardsUOffset<&'a str>>>>(Monster::VT_TESTARRAYOFSTRING, None)
1211   }
1212   /// an example documentation comment: this will end up in the generated code
1213   /// multiline too
1214   #[inline]
testarrayoftables(&self) -> Option<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<Monster<'a>>>>1215   pub fn testarrayoftables(&self) -> Option<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<Monster<'a>>>> {
1216     self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<flatbuffers::ForwardsUOffset<Monster<'a>>>>>(Monster::VT_TESTARRAYOFTABLES, None)
1217   }
1218   #[inline]
enemy(&self) -> Option<Monster<'a>>1219   pub fn enemy(&self) -> Option<Monster<'a>> {
1220     self._tab.get::<flatbuffers::ForwardsUOffset<Monster<'a>>>(Monster::VT_ENEMY, None)
1221   }
1222   #[inline]
testnestedflatbuffer(&self) -> Option<&'a [u8]>1223   pub fn testnestedflatbuffer(&self) -> Option<&'a [u8]> {
1224     self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, u8>>>(Monster::VT_TESTNESTEDFLATBUFFER, None).map(|v| v.safe_slice())
1225   }
testnestedflatbuffer_nested_flatbuffer(&'a self) -> Option<Monster<'a>>1226   pub fn testnestedflatbuffer_nested_flatbuffer(&'a self) ->  Option<Monster<'a>> {
1227      match self.testnestedflatbuffer() {
1228          None => { None }
1229          Some(data) => {
1230              use self::flatbuffers::Follow;
1231              Some(<flatbuffers::ForwardsUOffset<Monster<'a>>>::follow(data, 0))
1232          },
1233      }
1234   }
1235   #[inline]
testempty(&self) -> Option<Stat<'a>>1236   pub fn testempty(&self) -> Option<Stat<'a>> {
1237     self._tab.get::<flatbuffers::ForwardsUOffset<Stat<'a>>>(Monster::VT_TESTEMPTY, None)
1238   }
1239   #[inline]
testbool(&self) -> bool1240   pub fn testbool(&self) -> bool {
1241     self._tab.get::<bool>(Monster::VT_TESTBOOL, Some(false)).unwrap()
1242   }
1243   #[inline]
testhashs32_fnv1(&self) -> i321244   pub fn testhashs32_fnv1(&self) -> i32 {
1245     self._tab.get::<i32>(Monster::VT_TESTHASHS32_FNV1, Some(0)).unwrap()
1246   }
1247   #[inline]
testhashu32_fnv1(&self) -> u321248   pub fn testhashu32_fnv1(&self) -> u32 {
1249     self._tab.get::<u32>(Monster::VT_TESTHASHU32_FNV1, Some(0)).unwrap()
1250   }
1251   #[inline]
testhashs64_fnv1(&self) -> i641252   pub fn testhashs64_fnv1(&self) -> i64 {
1253     self._tab.get::<i64>(Monster::VT_TESTHASHS64_FNV1, Some(0)).unwrap()
1254   }
1255   #[inline]
testhashu64_fnv1(&self) -> u641256   pub fn testhashu64_fnv1(&self) -> u64 {
1257     self._tab.get::<u64>(Monster::VT_TESTHASHU64_FNV1, Some(0)).unwrap()
1258   }
1259   #[inline]
testhashs32_fnv1a(&self) -> i321260   pub fn testhashs32_fnv1a(&self) -> i32 {
1261     self._tab.get::<i32>(Monster::VT_TESTHASHS32_FNV1A, Some(0)).unwrap()
1262   }
1263   #[inline]
testhashu32_fnv1a(&self) -> u321264   pub fn testhashu32_fnv1a(&self) -> u32 {
1265     self._tab.get::<u32>(Monster::VT_TESTHASHU32_FNV1A, Some(0)).unwrap()
1266   }
1267   #[inline]
testhashs64_fnv1a(&self) -> i641268   pub fn testhashs64_fnv1a(&self) -> i64 {
1269     self._tab.get::<i64>(Monster::VT_TESTHASHS64_FNV1A, Some(0)).unwrap()
1270   }
1271   #[inline]
testhashu64_fnv1a(&self) -> u641272   pub fn testhashu64_fnv1a(&self) -> u64 {
1273     self._tab.get::<u64>(Monster::VT_TESTHASHU64_FNV1A, Some(0)).unwrap()
1274   }
1275   #[inline]
testarrayofbools(&self) -> Option<&'a [bool]>1276   pub fn testarrayofbools(&self) -> Option<&'a [bool]> {
1277     self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, bool>>>(Monster::VT_TESTARRAYOFBOOLS, None).map(|v| v.safe_slice())
1278   }
1279   #[inline]
testf(&self) -> f321280   pub fn testf(&self) -> f32 {
1281     self._tab.get::<f32>(Monster::VT_TESTF, Some(3.14159)).unwrap()
1282   }
1283   #[inline]
testf2(&self) -> f321284   pub fn testf2(&self) -> f32 {
1285     self._tab.get::<f32>(Monster::VT_TESTF2, Some(3.0)).unwrap()
1286   }
1287   #[inline]
testf3(&self) -> f321288   pub fn testf3(&self) -> f32 {
1289     self._tab.get::<f32>(Monster::VT_TESTF3, Some(0.0)).unwrap()
1290   }
1291   #[inline]
testarrayofstring2(&self) -> Option<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<&'a str>>>1292   pub fn testarrayofstring2(&self) -> Option<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<&'a str>>> {
1293     self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<flatbuffers::ForwardsUOffset<&'a str>>>>(Monster::VT_TESTARRAYOFSTRING2, None)
1294   }
1295   #[inline]
testarrayofsortedstruct(&self) -> Option<&'a [Ability]>1296   pub fn testarrayofsortedstruct(&self) -> Option<&'a [Ability]> {
1297     self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<Ability>>>(Monster::VT_TESTARRAYOFSORTEDSTRUCT, None).map(|v| v.safe_slice() )
1298   }
1299   #[inline]
flex(&self) -> Option<&'a [u8]>1300   pub fn flex(&self) -> Option<&'a [u8]> {
1301     self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, u8>>>(Monster::VT_FLEX, None).map(|v| v.safe_slice())
1302   }
1303   #[inline]
test5(&self) -> Option<&'a [Test]>1304   pub fn test5(&self) -> Option<&'a [Test]> {
1305     self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<Test>>>(Monster::VT_TEST5, None).map(|v| v.safe_slice() )
1306   }
1307   #[inline]
vector_of_longs(&self) -> Option<flatbuffers::Vector<'a, i64>>1308   pub fn vector_of_longs(&self) -> Option<flatbuffers::Vector<'a, i64>> {
1309     self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, i64>>>(Monster::VT_VECTOR_OF_LONGS, None)
1310   }
1311   #[inline]
vector_of_doubles(&self) -> Option<flatbuffers::Vector<'a, f64>>1312   pub fn vector_of_doubles(&self) -> Option<flatbuffers::Vector<'a, f64>> {
1313     self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, f64>>>(Monster::VT_VECTOR_OF_DOUBLES, None)
1314   }
1315   #[inline]
parent_namespace_test(&self) -> Option<super::InParentNamespace<'a>>1316   pub fn parent_namespace_test(&self) -> Option<super::InParentNamespace<'a>> {
1317     self._tab.get::<flatbuffers::ForwardsUOffset<super::InParentNamespace<'a>>>(Monster::VT_PARENT_NAMESPACE_TEST, None)
1318   }
1319   #[inline]
vector_of_referrables(&self) -> Option<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<Referrable<'a>>>>1320   pub fn vector_of_referrables(&self) -> Option<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<Referrable<'a>>>> {
1321     self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<flatbuffers::ForwardsUOffset<Referrable<'a>>>>>(Monster::VT_VECTOR_OF_REFERRABLES, None)
1322   }
1323   #[inline]
single_weak_reference(&self) -> u641324   pub fn single_weak_reference(&self) -> u64 {
1325     self._tab.get::<u64>(Monster::VT_SINGLE_WEAK_REFERENCE, Some(0)).unwrap()
1326   }
1327   #[inline]
vector_of_weak_references(&self) -> Option<flatbuffers::Vector<'a, u64>>1328   pub fn vector_of_weak_references(&self) -> Option<flatbuffers::Vector<'a, u64>> {
1329     self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, u64>>>(Monster::VT_VECTOR_OF_WEAK_REFERENCES, None)
1330   }
1331   #[inline]
vector_of_strong_referrables(&self) -> Option<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<Referrable<'a>>>>1332   pub fn vector_of_strong_referrables(&self) -> Option<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<Referrable<'a>>>> {
1333     self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<flatbuffers::ForwardsUOffset<Referrable<'a>>>>>(Monster::VT_VECTOR_OF_STRONG_REFERRABLES, None)
1334   }
1335   #[inline]
co_owning_reference(&self) -> u641336   pub fn co_owning_reference(&self) -> u64 {
1337     self._tab.get::<u64>(Monster::VT_CO_OWNING_REFERENCE, Some(0)).unwrap()
1338   }
1339   #[inline]
vector_of_co_owning_references(&self) -> Option<flatbuffers::Vector<'a, u64>>1340   pub fn vector_of_co_owning_references(&self) -> Option<flatbuffers::Vector<'a, u64>> {
1341     self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, u64>>>(Monster::VT_VECTOR_OF_CO_OWNING_REFERENCES, None)
1342   }
1343   #[inline]
non_owning_reference(&self) -> u641344   pub fn non_owning_reference(&self) -> u64 {
1345     self._tab.get::<u64>(Monster::VT_NON_OWNING_REFERENCE, Some(0)).unwrap()
1346   }
1347   #[inline]
vector_of_non_owning_references(&self) -> Option<flatbuffers::Vector<'a, u64>>1348   pub fn vector_of_non_owning_references(&self) -> Option<flatbuffers::Vector<'a, u64>> {
1349     self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, u64>>>(Monster::VT_VECTOR_OF_NON_OWNING_REFERENCES, None)
1350   }
1351   #[inline]
any_unique_type(&self) -> AnyUniqueAliases1352   pub fn any_unique_type(&self) -> AnyUniqueAliases {
1353     self._tab.get::<AnyUniqueAliases>(Monster::VT_ANY_UNIQUE_TYPE, Some(AnyUniqueAliases::NONE)).unwrap()
1354   }
1355   #[inline]
any_unique(&self) -> Option<flatbuffers::Table<'a>>1356   pub fn any_unique(&self) -> Option<flatbuffers::Table<'a>> {
1357     self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Table<'a>>>(Monster::VT_ANY_UNIQUE, None)
1358   }
1359   #[inline]
any_ambiguous_type(&self) -> AnyAmbiguousAliases1360   pub fn any_ambiguous_type(&self) -> AnyAmbiguousAliases {
1361     self._tab.get::<AnyAmbiguousAliases>(Monster::VT_ANY_AMBIGUOUS_TYPE, Some(AnyAmbiguousAliases::NONE)).unwrap()
1362   }
1363   #[inline]
any_ambiguous(&self) -> Option<flatbuffers::Table<'a>>1364   pub fn any_ambiguous(&self) -> Option<flatbuffers::Table<'a>> {
1365     self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Table<'a>>>(Monster::VT_ANY_AMBIGUOUS, None)
1366   }
1367   #[inline]
vector_of_enums(&self) -> Option<flatbuffers::Vector<'a, Color>>1368   pub fn vector_of_enums(&self) -> Option<flatbuffers::Vector<'a, Color>> {
1369     self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, Color>>>(Monster::VT_VECTOR_OF_ENUMS, None)
1370   }
1371   #[inline]
signed_enum(&self) -> Race1372   pub fn signed_enum(&self) -> Race {
1373     self._tab.get::<Race>(Monster::VT_SIGNED_ENUM, Some(Race::None)).unwrap()
1374   }
1375   #[inline]
1376   #[allow(non_snake_case)]
test_as_monster(&self) -> Option<Monster<'a>>1377   pub fn test_as_monster(&self) -> Option<Monster<'a>> {
1378     if self.test_type() == Any::Monster {
1379       self.test().map(|u| Monster::init_from_table(u))
1380     } else {
1381       None
1382     }
1383   }
1384 
1385   #[inline]
1386   #[allow(non_snake_case)]
test_as_test_simple_table_with_enum(&self) -> Option<TestSimpleTableWithEnum<'a>>1387   pub fn test_as_test_simple_table_with_enum(&self) -> Option<TestSimpleTableWithEnum<'a>> {
1388     if self.test_type() == Any::TestSimpleTableWithEnum {
1389       self.test().map(|u| TestSimpleTableWithEnum::init_from_table(u))
1390     } else {
1391       None
1392     }
1393   }
1394 
1395   #[inline]
1396   #[allow(non_snake_case)]
test_as_my_game_example_2_monster(&self) -> Option<super::example_2::Monster<'a>>1397   pub fn test_as_my_game_example_2_monster(&self) -> Option<super::example_2::Monster<'a>> {
1398     if self.test_type() == Any::MyGame_Example2_Monster {
1399       self.test().map(|u| super::example_2::Monster::init_from_table(u))
1400     } else {
1401       None
1402     }
1403   }
1404 
1405   #[inline]
1406   #[allow(non_snake_case)]
any_unique_as_m(&self) -> Option<Monster<'a>>1407   pub fn any_unique_as_m(&self) -> Option<Monster<'a>> {
1408     if self.any_unique_type() == AnyUniqueAliases::M {
1409       self.any_unique().map(|u| Monster::init_from_table(u))
1410     } else {
1411       None
1412     }
1413   }
1414 
1415   #[inline]
1416   #[allow(non_snake_case)]
any_unique_as_ts(&self) -> Option<TestSimpleTableWithEnum<'a>>1417   pub fn any_unique_as_ts(&self) -> Option<TestSimpleTableWithEnum<'a>> {
1418     if self.any_unique_type() == AnyUniqueAliases::TS {
1419       self.any_unique().map(|u| TestSimpleTableWithEnum::init_from_table(u))
1420     } else {
1421       None
1422     }
1423   }
1424 
1425   #[inline]
1426   #[allow(non_snake_case)]
any_unique_as_m2(&self) -> Option<super::example_2::Monster<'a>>1427   pub fn any_unique_as_m2(&self) -> Option<super::example_2::Monster<'a>> {
1428     if self.any_unique_type() == AnyUniqueAliases::M2 {
1429       self.any_unique().map(|u| super::example_2::Monster::init_from_table(u))
1430     } else {
1431       None
1432     }
1433   }
1434 
1435   #[inline]
1436   #[allow(non_snake_case)]
any_ambiguous_as_m1(&self) -> Option<Monster<'a>>1437   pub fn any_ambiguous_as_m1(&self) -> Option<Monster<'a>> {
1438     if self.any_ambiguous_type() == AnyAmbiguousAliases::M1 {
1439       self.any_ambiguous().map(|u| Monster::init_from_table(u))
1440     } else {
1441       None
1442     }
1443   }
1444 
1445   #[inline]
1446   #[allow(non_snake_case)]
any_ambiguous_as_m2(&self) -> Option<Monster<'a>>1447   pub fn any_ambiguous_as_m2(&self) -> Option<Monster<'a>> {
1448     if self.any_ambiguous_type() == AnyAmbiguousAliases::M2 {
1449       self.any_ambiguous().map(|u| Monster::init_from_table(u))
1450     } else {
1451       None
1452     }
1453   }
1454 
1455   #[inline]
1456   #[allow(non_snake_case)]
any_ambiguous_as_m3(&self) -> Option<Monster<'a>>1457   pub fn any_ambiguous_as_m3(&self) -> Option<Monster<'a>> {
1458     if self.any_ambiguous_type() == AnyAmbiguousAliases::M3 {
1459       self.any_ambiguous().map(|u| Monster::init_from_table(u))
1460     } else {
1461       None
1462     }
1463   }
1464 
1465 }
1466 
1467 pub struct MonsterArgs<'a> {
1468     pub pos: Option<&'a  Vec3>,
1469     pub mana: i16,
1470     pub hp: i16,
1471     pub name: Option<flatbuffers::WIPOffset<&'a  str>>,
1472     pub inventory: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a ,  u8>>>,
1473     pub color: Color,
1474     pub test_type: Any,
1475     pub test: Option<flatbuffers::WIPOffset<flatbuffers::UnionWIPOffset>>,
1476     pub test4: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a , Test>>>,
1477     pub testarrayofstring: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a , flatbuffers::ForwardsUOffset<&'a  str>>>>,
1478     pub testarrayoftables: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a , flatbuffers::ForwardsUOffset<Monster<'a >>>>>,
1479     pub enemy: Option<flatbuffers::WIPOffset<Monster<'a >>>,
1480     pub testnestedflatbuffer: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a ,  u8>>>,
1481     pub testempty: Option<flatbuffers::WIPOffset<Stat<'a >>>,
1482     pub testbool: bool,
1483     pub testhashs32_fnv1: i32,
1484     pub testhashu32_fnv1: u32,
1485     pub testhashs64_fnv1: i64,
1486     pub testhashu64_fnv1: u64,
1487     pub testhashs32_fnv1a: i32,
1488     pub testhashu32_fnv1a: u32,
1489     pub testhashs64_fnv1a: i64,
1490     pub testhashu64_fnv1a: u64,
1491     pub testarrayofbools: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a , bool>>>,
1492     pub testf: f32,
1493     pub testf2: f32,
1494     pub testf3: f32,
1495     pub testarrayofstring2: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a , flatbuffers::ForwardsUOffset<&'a  str>>>>,
1496     pub testarrayofsortedstruct: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a , Ability>>>,
1497     pub flex: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a ,  u8>>>,
1498     pub test5: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a , Test>>>,
1499     pub vector_of_longs: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a ,  i64>>>,
1500     pub vector_of_doubles: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a ,  f64>>>,
1501     pub parent_namespace_test: Option<flatbuffers::WIPOffset<super::InParentNamespace<'a >>>,
1502     pub vector_of_referrables: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a , flatbuffers::ForwardsUOffset<Referrable<'a >>>>>,
1503     pub single_weak_reference: u64,
1504     pub vector_of_weak_references: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a ,  u64>>>,
1505     pub vector_of_strong_referrables: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a , flatbuffers::ForwardsUOffset<Referrable<'a >>>>>,
1506     pub co_owning_reference: u64,
1507     pub vector_of_co_owning_references: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a ,  u64>>>,
1508     pub non_owning_reference: u64,
1509     pub vector_of_non_owning_references: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a ,  u64>>>,
1510     pub any_unique_type: AnyUniqueAliases,
1511     pub any_unique: Option<flatbuffers::WIPOffset<flatbuffers::UnionWIPOffset>>,
1512     pub any_ambiguous_type: AnyAmbiguousAliases,
1513     pub any_ambiguous: Option<flatbuffers::WIPOffset<flatbuffers::UnionWIPOffset>>,
1514     pub vector_of_enums: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a , Color>>>,
1515     pub signed_enum: Race,
1516 }
1517 impl<'a> Default for MonsterArgs<'a> {
1518     #[inline]
default() -> Self1519     fn default() -> Self {
1520         MonsterArgs {
1521             pos: None,
1522             mana: 150,
1523             hp: 100,
1524             name: None, // required field
1525             inventory: None,
1526             color: Color::Blue,
1527             test_type: Any::NONE,
1528             test: None,
1529             test4: None,
1530             testarrayofstring: None,
1531             testarrayoftables: None,
1532             enemy: None,
1533             testnestedflatbuffer: None,
1534             testempty: None,
1535             testbool: false,
1536             testhashs32_fnv1: 0,
1537             testhashu32_fnv1: 0,
1538             testhashs64_fnv1: 0,
1539             testhashu64_fnv1: 0,
1540             testhashs32_fnv1a: 0,
1541             testhashu32_fnv1a: 0,
1542             testhashs64_fnv1a: 0,
1543             testhashu64_fnv1a: 0,
1544             testarrayofbools: None,
1545             testf: 3.14159,
1546             testf2: 3.0,
1547             testf3: 0.0,
1548             testarrayofstring2: None,
1549             testarrayofsortedstruct: None,
1550             flex: None,
1551             test5: None,
1552             vector_of_longs: None,
1553             vector_of_doubles: None,
1554             parent_namespace_test: None,
1555             vector_of_referrables: None,
1556             single_weak_reference: 0,
1557             vector_of_weak_references: None,
1558             vector_of_strong_referrables: None,
1559             co_owning_reference: 0,
1560             vector_of_co_owning_references: None,
1561             non_owning_reference: 0,
1562             vector_of_non_owning_references: None,
1563             any_unique_type: AnyUniqueAliases::NONE,
1564             any_unique: None,
1565             any_ambiguous_type: AnyAmbiguousAliases::NONE,
1566             any_ambiguous: None,
1567             vector_of_enums: None,
1568             signed_enum: Race::None,
1569         }
1570     }
1571 }
1572 pub struct MonsterBuilder<'a: 'b, 'b> {
1573   fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a>,
1574   start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
1575 }
1576 impl<'a: 'b, 'b> MonsterBuilder<'a, 'b> {
1577   #[inline]
add_pos(&mut self, pos: &'b Vec3)1578   pub fn add_pos(&mut self, pos: &'b  Vec3) {
1579     self.fbb_.push_slot_always::<&Vec3>(Monster::VT_POS, pos);
1580   }
1581   #[inline]
add_mana(&mut self, mana: i16)1582   pub fn add_mana(&mut self, mana: i16) {
1583     self.fbb_.push_slot::<i16>(Monster::VT_MANA, mana, 150);
1584   }
1585   #[inline]
add_hp(&mut self, hp: i16)1586   pub fn add_hp(&mut self, hp: i16) {
1587     self.fbb_.push_slot::<i16>(Monster::VT_HP, hp, 100);
1588   }
1589   #[inline]
add_name(&mut self, name: flatbuffers::WIPOffset<&'b str>)1590   pub fn add_name(&mut self, name: flatbuffers::WIPOffset<&'b  str>) {
1591     self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Monster::VT_NAME, name);
1592   }
1593   #[inline]
add_inventory(&mut self, inventory: flatbuffers::WIPOffset<flatbuffers::Vector<'b , u8>>)1594   pub fn add_inventory(&mut self, inventory: flatbuffers::WIPOffset<flatbuffers::Vector<'b , u8>>) {
1595     self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Monster::VT_INVENTORY, inventory);
1596   }
1597   #[inline]
add_color(&mut self, color: Color)1598   pub fn add_color(&mut self, color: Color) {
1599     self.fbb_.push_slot::<Color>(Monster::VT_COLOR, color, Color::Blue);
1600   }
1601   #[inline]
add_test_type(&mut self, test_type: Any)1602   pub fn add_test_type(&mut self, test_type: Any) {
1603     self.fbb_.push_slot::<Any>(Monster::VT_TEST_TYPE, test_type, Any::NONE);
1604   }
1605   #[inline]
add_test(&mut self, test: flatbuffers::WIPOffset<flatbuffers::UnionWIPOffset>)1606   pub fn add_test(&mut self, test: flatbuffers::WIPOffset<flatbuffers::UnionWIPOffset>) {
1607     self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Monster::VT_TEST, test);
1608   }
1609   #[inline]
add_test4(&mut self, test4: flatbuffers::WIPOffset<flatbuffers::Vector<'b , Test>>)1610   pub fn add_test4(&mut self, test4: flatbuffers::WIPOffset<flatbuffers::Vector<'b , Test>>) {
1611     self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Monster::VT_TEST4, test4);
1612   }
1613   #[inline]
add_testarrayofstring(&mut self, testarrayofstring: flatbuffers::WIPOffset<flatbuffers::Vector<'b , flatbuffers::ForwardsUOffset<&'b str>>>)1614   pub fn add_testarrayofstring(&mut self, testarrayofstring: flatbuffers::WIPOffset<flatbuffers::Vector<'b , flatbuffers::ForwardsUOffset<&'b  str>>>) {
1615     self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Monster::VT_TESTARRAYOFSTRING, testarrayofstring);
1616   }
1617   #[inline]
add_testarrayoftables(&mut self, testarrayoftables: flatbuffers::WIPOffset<flatbuffers::Vector<'b , flatbuffers::ForwardsUOffset<Monster<'b >>>>)1618   pub fn add_testarrayoftables(&mut self, testarrayoftables: flatbuffers::WIPOffset<flatbuffers::Vector<'b , flatbuffers::ForwardsUOffset<Monster<'b >>>>) {
1619     self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Monster::VT_TESTARRAYOFTABLES, testarrayoftables);
1620   }
1621   #[inline]
add_enemy(&mut self, enemy: flatbuffers::WIPOffset<Monster<'b >>)1622   pub fn add_enemy(&mut self, enemy: flatbuffers::WIPOffset<Monster<'b >>) {
1623     self.fbb_.push_slot_always::<flatbuffers::WIPOffset<Monster>>(Monster::VT_ENEMY, enemy);
1624   }
1625   #[inline]
add_testnestedflatbuffer(&mut self, testnestedflatbuffer: flatbuffers::WIPOffset<flatbuffers::Vector<'b , u8>>)1626   pub fn add_testnestedflatbuffer(&mut self, testnestedflatbuffer: flatbuffers::WIPOffset<flatbuffers::Vector<'b , u8>>) {
1627     self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Monster::VT_TESTNESTEDFLATBUFFER, testnestedflatbuffer);
1628   }
1629   #[inline]
add_testempty(&mut self, testempty: flatbuffers::WIPOffset<Stat<'b >>)1630   pub fn add_testempty(&mut self, testempty: flatbuffers::WIPOffset<Stat<'b >>) {
1631     self.fbb_.push_slot_always::<flatbuffers::WIPOffset<Stat>>(Monster::VT_TESTEMPTY, testempty);
1632   }
1633   #[inline]
add_testbool(&mut self, testbool: bool)1634   pub fn add_testbool(&mut self, testbool: bool) {
1635     self.fbb_.push_slot::<bool>(Monster::VT_TESTBOOL, testbool, false);
1636   }
1637   #[inline]
add_testhashs32_fnv1(&mut self, testhashs32_fnv1: i32)1638   pub fn add_testhashs32_fnv1(&mut self, testhashs32_fnv1: i32) {
1639     self.fbb_.push_slot::<i32>(Monster::VT_TESTHASHS32_FNV1, testhashs32_fnv1, 0);
1640   }
1641   #[inline]
add_testhashu32_fnv1(&mut self, testhashu32_fnv1: u32)1642   pub fn add_testhashu32_fnv1(&mut self, testhashu32_fnv1: u32) {
1643     self.fbb_.push_slot::<u32>(Monster::VT_TESTHASHU32_FNV1, testhashu32_fnv1, 0);
1644   }
1645   #[inline]
add_testhashs64_fnv1(&mut self, testhashs64_fnv1: i64)1646   pub fn add_testhashs64_fnv1(&mut self, testhashs64_fnv1: i64) {
1647     self.fbb_.push_slot::<i64>(Monster::VT_TESTHASHS64_FNV1, testhashs64_fnv1, 0);
1648   }
1649   #[inline]
add_testhashu64_fnv1(&mut self, testhashu64_fnv1: u64)1650   pub fn add_testhashu64_fnv1(&mut self, testhashu64_fnv1: u64) {
1651     self.fbb_.push_slot::<u64>(Monster::VT_TESTHASHU64_FNV1, testhashu64_fnv1, 0);
1652   }
1653   #[inline]
add_testhashs32_fnv1a(&mut self, testhashs32_fnv1a: i32)1654   pub fn add_testhashs32_fnv1a(&mut self, testhashs32_fnv1a: i32) {
1655     self.fbb_.push_slot::<i32>(Monster::VT_TESTHASHS32_FNV1A, testhashs32_fnv1a, 0);
1656   }
1657   #[inline]
add_testhashu32_fnv1a(&mut self, testhashu32_fnv1a: u32)1658   pub fn add_testhashu32_fnv1a(&mut self, testhashu32_fnv1a: u32) {
1659     self.fbb_.push_slot::<u32>(Monster::VT_TESTHASHU32_FNV1A, testhashu32_fnv1a, 0);
1660   }
1661   #[inline]
add_testhashs64_fnv1a(&mut self, testhashs64_fnv1a: i64)1662   pub fn add_testhashs64_fnv1a(&mut self, testhashs64_fnv1a: i64) {
1663     self.fbb_.push_slot::<i64>(Monster::VT_TESTHASHS64_FNV1A, testhashs64_fnv1a, 0);
1664   }
1665   #[inline]
add_testhashu64_fnv1a(&mut self, testhashu64_fnv1a: u64)1666   pub fn add_testhashu64_fnv1a(&mut self, testhashu64_fnv1a: u64) {
1667     self.fbb_.push_slot::<u64>(Monster::VT_TESTHASHU64_FNV1A, testhashu64_fnv1a, 0);
1668   }
1669   #[inline]
add_testarrayofbools(&mut self, testarrayofbools: flatbuffers::WIPOffset<flatbuffers::Vector<'b , bool>>)1670   pub fn add_testarrayofbools(&mut self, testarrayofbools: flatbuffers::WIPOffset<flatbuffers::Vector<'b , bool>>) {
1671     self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Monster::VT_TESTARRAYOFBOOLS, testarrayofbools);
1672   }
1673   #[inline]
add_testf(&mut self, testf: f32)1674   pub fn add_testf(&mut self, testf: f32) {
1675     self.fbb_.push_slot::<f32>(Monster::VT_TESTF, testf, 3.14159);
1676   }
1677   #[inline]
add_testf2(&mut self, testf2: f32)1678   pub fn add_testf2(&mut self, testf2: f32) {
1679     self.fbb_.push_slot::<f32>(Monster::VT_TESTF2, testf2, 3.0);
1680   }
1681   #[inline]
add_testf3(&mut self, testf3: f32)1682   pub fn add_testf3(&mut self, testf3: f32) {
1683     self.fbb_.push_slot::<f32>(Monster::VT_TESTF3, testf3, 0.0);
1684   }
1685   #[inline]
add_testarrayofstring2(&mut self, testarrayofstring2: flatbuffers::WIPOffset<flatbuffers::Vector<'b , flatbuffers::ForwardsUOffset<&'b str>>>)1686   pub fn add_testarrayofstring2(&mut self, testarrayofstring2: flatbuffers::WIPOffset<flatbuffers::Vector<'b , flatbuffers::ForwardsUOffset<&'b  str>>>) {
1687     self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Monster::VT_TESTARRAYOFSTRING2, testarrayofstring2);
1688   }
1689   #[inline]
add_testarrayofsortedstruct(&mut self, testarrayofsortedstruct: flatbuffers::WIPOffset<flatbuffers::Vector<'b , Ability>>)1690   pub fn add_testarrayofsortedstruct(&mut self, testarrayofsortedstruct: flatbuffers::WIPOffset<flatbuffers::Vector<'b , Ability>>) {
1691     self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Monster::VT_TESTARRAYOFSORTEDSTRUCT, testarrayofsortedstruct);
1692   }
1693   #[inline]
add_flex(&mut self, flex: flatbuffers::WIPOffset<flatbuffers::Vector<'b , u8>>)1694   pub fn add_flex(&mut self, flex: flatbuffers::WIPOffset<flatbuffers::Vector<'b , u8>>) {
1695     self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Monster::VT_FLEX, flex);
1696   }
1697   #[inline]
add_test5(&mut self, test5: flatbuffers::WIPOffset<flatbuffers::Vector<'b , Test>>)1698   pub fn add_test5(&mut self, test5: flatbuffers::WIPOffset<flatbuffers::Vector<'b , Test>>) {
1699     self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Monster::VT_TEST5, test5);
1700   }
1701   #[inline]
add_vector_of_longs(&mut self, vector_of_longs: flatbuffers::WIPOffset<flatbuffers::Vector<'b , i64>>)1702   pub fn add_vector_of_longs(&mut self, vector_of_longs: flatbuffers::WIPOffset<flatbuffers::Vector<'b , i64>>) {
1703     self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Monster::VT_VECTOR_OF_LONGS, vector_of_longs);
1704   }
1705   #[inline]
add_vector_of_doubles(&mut self, vector_of_doubles: flatbuffers::WIPOffset<flatbuffers::Vector<'b , f64>>)1706   pub fn add_vector_of_doubles(&mut self, vector_of_doubles: flatbuffers::WIPOffset<flatbuffers::Vector<'b , f64>>) {
1707     self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Monster::VT_VECTOR_OF_DOUBLES, vector_of_doubles);
1708   }
1709   #[inline]
add_parent_namespace_test(&mut self, parent_namespace_test: flatbuffers::WIPOffset<super::InParentNamespace<'b >>)1710   pub fn add_parent_namespace_test(&mut self, parent_namespace_test: flatbuffers::WIPOffset<super::InParentNamespace<'b >>) {
1711     self.fbb_.push_slot_always::<flatbuffers::WIPOffset<super::InParentNamespace>>(Monster::VT_PARENT_NAMESPACE_TEST, parent_namespace_test);
1712   }
1713   #[inline]
add_vector_of_referrables(&mut self, vector_of_referrables: flatbuffers::WIPOffset<flatbuffers::Vector<'b , flatbuffers::ForwardsUOffset<Referrable<'b >>>>)1714   pub fn add_vector_of_referrables(&mut self, vector_of_referrables: flatbuffers::WIPOffset<flatbuffers::Vector<'b , flatbuffers::ForwardsUOffset<Referrable<'b >>>>) {
1715     self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Monster::VT_VECTOR_OF_REFERRABLES, vector_of_referrables);
1716   }
1717   #[inline]
add_single_weak_reference(&mut self, single_weak_reference: u64)1718   pub fn add_single_weak_reference(&mut self, single_weak_reference: u64) {
1719     self.fbb_.push_slot::<u64>(Monster::VT_SINGLE_WEAK_REFERENCE, single_weak_reference, 0);
1720   }
1721   #[inline]
add_vector_of_weak_references(&mut self, vector_of_weak_references: flatbuffers::WIPOffset<flatbuffers::Vector<'b , u64>>)1722   pub fn add_vector_of_weak_references(&mut self, vector_of_weak_references: flatbuffers::WIPOffset<flatbuffers::Vector<'b , u64>>) {
1723     self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Monster::VT_VECTOR_OF_WEAK_REFERENCES, vector_of_weak_references);
1724   }
1725   #[inline]
add_vector_of_strong_referrables(&mut self, vector_of_strong_referrables: flatbuffers::WIPOffset<flatbuffers::Vector<'b , flatbuffers::ForwardsUOffset<Referrable<'b >>>>)1726   pub fn add_vector_of_strong_referrables(&mut self, vector_of_strong_referrables: flatbuffers::WIPOffset<flatbuffers::Vector<'b , flatbuffers::ForwardsUOffset<Referrable<'b >>>>) {
1727     self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Monster::VT_VECTOR_OF_STRONG_REFERRABLES, vector_of_strong_referrables);
1728   }
1729   #[inline]
add_co_owning_reference(&mut self, co_owning_reference: u64)1730   pub fn add_co_owning_reference(&mut self, co_owning_reference: u64) {
1731     self.fbb_.push_slot::<u64>(Monster::VT_CO_OWNING_REFERENCE, co_owning_reference, 0);
1732   }
1733   #[inline]
add_vector_of_co_owning_references(&mut self, vector_of_co_owning_references: flatbuffers::WIPOffset<flatbuffers::Vector<'b , u64>>)1734   pub fn add_vector_of_co_owning_references(&mut self, vector_of_co_owning_references: flatbuffers::WIPOffset<flatbuffers::Vector<'b , u64>>) {
1735     self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Monster::VT_VECTOR_OF_CO_OWNING_REFERENCES, vector_of_co_owning_references);
1736   }
1737   #[inline]
add_non_owning_reference(&mut self, non_owning_reference: u64)1738   pub fn add_non_owning_reference(&mut self, non_owning_reference: u64) {
1739     self.fbb_.push_slot::<u64>(Monster::VT_NON_OWNING_REFERENCE, non_owning_reference, 0);
1740   }
1741   #[inline]
add_vector_of_non_owning_references(&mut self, vector_of_non_owning_references: flatbuffers::WIPOffset<flatbuffers::Vector<'b , u64>>)1742   pub fn add_vector_of_non_owning_references(&mut self, vector_of_non_owning_references: flatbuffers::WIPOffset<flatbuffers::Vector<'b , u64>>) {
1743     self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Monster::VT_VECTOR_OF_NON_OWNING_REFERENCES, vector_of_non_owning_references);
1744   }
1745   #[inline]
add_any_unique_type(&mut self, any_unique_type: AnyUniqueAliases)1746   pub fn add_any_unique_type(&mut self, any_unique_type: AnyUniqueAliases) {
1747     self.fbb_.push_slot::<AnyUniqueAliases>(Monster::VT_ANY_UNIQUE_TYPE, any_unique_type, AnyUniqueAliases::NONE);
1748   }
1749   #[inline]
add_any_unique(&mut self, any_unique: flatbuffers::WIPOffset<flatbuffers::UnionWIPOffset>)1750   pub fn add_any_unique(&mut self, any_unique: flatbuffers::WIPOffset<flatbuffers::UnionWIPOffset>) {
1751     self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Monster::VT_ANY_UNIQUE, any_unique);
1752   }
1753   #[inline]
add_any_ambiguous_type(&mut self, any_ambiguous_type: AnyAmbiguousAliases)1754   pub fn add_any_ambiguous_type(&mut self, any_ambiguous_type: AnyAmbiguousAliases) {
1755     self.fbb_.push_slot::<AnyAmbiguousAliases>(Monster::VT_ANY_AMBIGUOUS_TYPE, any_ambiguous_type, AnyAmbiguousAliases::NONE);
1756   }
1757   #[inline]
add_any_ambiguous(&mut self, any_ambiguous: flatbuffers::WIPOffset<flatbuffers::UnionWIPOffset>)1758   pub fn add_any_ambiguous(&mut self, any_ambiguous: flatbuffers::WIPOffset<flatbuffers::UnionWIPOffset>) {
1759     self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Monster::VT_ANY_AMBIGUOUS, any_ambiguous);
1760   }
1761   #[inline]
add_vector_of_enums(&mut self, vector_of_enums: flatbuffers::WIPOffset<flatbuffers::Vector<'b , Color>>)1762   pub fn add_vector_of_enums(&mut self, vector_of_enums: flatbuffers::WIPOffset<flatbuffers::Vector<'b , Color>>) {
1763     self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Monster::VT_VECTOR_OF_ENUMS, vector_of_enums);
1764   }
1765   #[inline]
add_signed_enum(&mut self, signed_enum: Race)1766   pub fn add_signed_enum(&mut self, signed_enum: Race) {
1767     self.fbb_.push_slot::<Race>(Monster::VT_SIGNED_ENUM, signed_enum, Race::None);
1768   }
1769   #[inline]
new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> MonsterBuilder<'a, 'b>1770   pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> MonsterBuilder<'a, 'b> {
1771     let start = _fbb.start_table();
1772     MonsterBuilder {
1773       fbb_: _fbb,
1774       start_: start,
1775     }
1776   }
1777   #[inline]
finish(self) -> flatbuffers::WIPOffset<Monster<'a>>1778   pub fn finish(self) -> flatbuffers::WIPOffset<Monster<'a>> {
1779     let o = self.fbb_.end_table(self.start_);
1780     self.fbb_.required(o, Monster::VT_NAME,"name");
1781     flatbuffers::WIPOffset::new(o.value())
1782   }
1783 }
1784 
1785 pub enum TypeAliasesOffset {}
1786 #[derive(Copy, Clone, Debug, PartialEq)]
1787 
1788 pub struct TypeAliases<'a> {
1789   pub _tab: flatbuffers::Table<'a>,
1790 }
1791 
1792 impl<'a> flatbuffers::Follow<'a> for TypeAliases<'a> {
1793     type Inner = TypeAliases<'a>;
1794     #[inline]
follow(buf: &'a [u8], loc: usize) -> Self::Inner1795     fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
1796         Self {
1797             _tab: flatbuffers::Table { buf: buf, loc: loc },
1798         }
1799     }
1800 }
1801 
1802 impl<'a> TypeAliases<'a> {
get_fully_qualified_name() -> &'static str1803     pub const fn get_fully_qualified_name() -> &'static str {
1804         "MyGame.Example.TypeAliases"
1805     }
1806 
1807     #[inline]
init_from_table(table: flatbuffers::Table<'a>) -> Self1808     pub fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
1809         TypeAliases {
1810             _tab: table,
1811         }
1812     }
1813     #[allow(unused_mut)]
create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>( _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>, args: &'args TypeAliasesArgs<'args>) -> flatbuffers::WIPOffset<TypeAliases<'bldr>>1814     pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>(
1815         _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>,
1816         args: &'args TypeAliasesArgs<'args>) -> flatbuffers::WIPOffset<TypeAliases<'bldr>> {
1817       let mut builder = TypeAliasesBuilder::new(_fbb);
1818       builder.add_f64_(args.f64_);
1819       builder.add_u64_(args.u64_);
1820       builder.add_i64_(args.i64_);
1821       if let Some(x) = args.vf64 { builder.add_vf64(x); }
1822       if let Some(x) = args.v8 { builder.add_v8(x); }
1823       builder.add_f32_(args.f32_);
1824       builder.add_u32_(args.u32_);
1825       builder.add_i32_(args.i32_);
1826       builder.add_u16_(args.u16_);
1827       builder.add_i16_(args.i16_);
1828       builder.add_u8_(args.u8_);
1829       builder.add_i8_(args.i8_);
1830       builder.finish()
1831     }
1832 
1833     pub const VT_I8_: flatbuffers::VOffsetT = 4;
1834     pub const VT_U8_: flatbuffers::VOffsetT = 6;
1835     pub const VT_I16_: flatbuffers::VOffsetT = 8;
1836     pub const VT_U16_: flatbuffers::VOffsetT = 10;
1837     pub const VT_I32_: flatbuffers::VOffsetT = 12;
1838     pub const VT_U32_: flatbuffers::VOffsetT = 14;
1839     pub const VT_I64_: flatbuffers::VOffsetT = 16;
1840     pub const VT_U64_: flatbuffers::VOffsetT = 18;
1841     pub const VT_F32_: flatbuffers::VOffsetT = 20;
1842     pub const VT_F64_: flatbuffers::VOffsetT = 22;
1843     pub const VT_V8: flatbuffers::VOffsetT = 24;
1844     pub const VT_VF64: flatbuffers::VOffsetT = 26;
1845 
1846   #[inline]
i8_(&self) -> i81847   pub fn i8_(&self) -> i8 {
1848     self._tab.get::<i8>(TypeAliases::VT_I8_, Some(0)).unwrap()
1849   }
1850   #[inline]
u8_(&self) -> u81851   pub fn u8_(&self) -> u8 {
1852     self._tab.get::<u8>(TypeAliases::VT_U8_, Some(0)).unwrap()
1853   }
1854   #[inline]
i16_(&self) -> i161855   pub fn i16_(&self) -> i16 {
1856     self._tab.get::<i16>(TypeAliases::VT_I16_, Some(0)).unwrap()
1857   }
1858   #[inline]
u16_(&self) -> u161859   pub fn u16_(&self) -> u16 {
1860     self._tab.get::<u16>(TypeAliases::VT_U16_, Some(0)).unwrap()
1861   }
1862   #[inline]
i32_(&self) -> i321863   pub fn i32_(&self) -> i32 {
1864     self._tab.get::<i32>(TypeAliases::VT_I32_, Some(0)).unwrap()
1865   }
1866   #[inline]
u32_(&self) -> u321867   pub fn u32_(&self) -> u32 {
1868     self._tab.get::<u32>(TypeAliases::VT_U32_, Some(0)).unwrap()
1869   }
1870   #[inline]
i64_(&self) -> i641871   pub fn i64_(&self) -> i64 {
1872     self._tab.get::<i64>(TypeAliases::VT_I64_, Some(0)).unwrap()
1873   }
1874   #[inline]
u64_(&self) -> u641875   pub fn u64_(&self) -> u64 {
1876     self._tab.get::<u64>(TypeAliases::VT_U64_, Some(0)).unwrap()
1877   }
1878   #[inline]
f32_(&self) -> f321879   pub fn f32_(&self) -> f32 {
1880     self._tab.get::<f32>(TypeAliases::VT_F32_, Some(0.0)).unwrap()
1881   }
1882   #[inline]
f64_(&self) -> f641883   pub fn f64_(&self) -> f64 {
1884     self._tab.get::<f64>(TypeAliases::VT_F64_, Some(0.0)).unwrap()
1885   }
1886   #[inline]
v8(&self) -> Option<&'a [i8]>1887   pub fn v8(&self) -> Option<&'a [i8]> {
1888     self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, i8>>>(TypeAliases::VT_V8, None).map(|v| v.safe_slice())
1889   }
1890   #[inline]
vf64(&self) -> Option<flatbuffers::Vector<'a, f64>>1891   pub fn vf64(&self) -> Option<flatbuffers::Vector<'a, f64>> {
1892     self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, f64>>>(TypeAliases::VT_VF64, None)
1893   }
1894 }
1895 
1896 pub struct TypeAliasesArgs<'a> {
1897     pub i8_: i8,
1898     pub u8_: u8,
1899     pub i16_: i16,
1900     pub u16_: u16,
1901     pub i32_: i32,
1902     pub u32_: u32,
1903     pub i64_: i64,
1904     pub u64_: u64,
1905     pub f32_: f32,
1906     pub f64_: f64,
1907     pub v8: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a ,  i8>>>,
1908     pub vf64: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a ,  f64>>>,
1909 }
1910 impl<'a> Default for TypeAliasesArgs<'a> {
1911     #[inline]
default() -> Self1912     fn default() -> Self {
1913         TypeAliasesArgs {
1914             i8_: 0,
1915             u8_: 0,
1916             i16_: 0,
1917             u16_: 0,
1918             i32_: 0,
1919             u32_: 0,
1920             i64_: 0,
1921             u64_: 0,
1922             f32_: 0.0,
1923             f64_: 0.0,
1924             v8: None,
1925             vf64: None,
1926         }
1927     }
1928 }
1929 pub struct TypeAliasesBuilder<'a: 'b, 'b> {
1930   fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a>,
1931   start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
1932 }
1933 impl<'a: 'b, 'b> TypeAliasesBuilder<'a, 'b> {
1934   #[inline]
add_i8_(&mut self, i8_: i8)1935   pub fn add_i8_(&mut self, i8_: i8) {
1936     self.fbb_.push_slot::<i8>(TypeAliases::VT_I8_, i8_, 0);
1937   }
1938   #[inline]
add_u8_(&mut self, u8_: u8)1939   pub fn add_u8_(&mut self, u8_: u8) {
1940     self.fbb_.push_slot::<u8>(TypeAliases::VT_U8_, u8_, 0);
1941   }
1942   #[inline]
add_i16_(&mut self, i16_: i16)1943   pub fn add_i16_(&mut self, i16_: i16) {
1944     self.fbb_.push_slot::<i16>(TypeAliases::VT_I16_, i16_, 0);
1945   }
1946   #[inline]
add_u16_(&mut self, u16_: u16)1947   pub fn add_u16_(&mut self, u16_: u16) {
1948     self.fbb_.push_slot::<u16>(TypeAliases::VT_U16_, u16_, 0);
1949   }
1950   #[inline]
add_i32_(&mut self, i32_: i32)1951   pub fn add_i32_(&mut self, i32_: i32) {
1952     self.fbb_.push_slot::<i32>(TypeAliases::VT_I32_, i32_, 0);
1953   }
1954   #[inline]
add_u32_(&mut self, u32_: u32)1955   pub fn add_u32_(&mut self, u32_: u32) {
1956     self.fbb_.push_slot::<u32>(TypeAliases::VT_U32_, u32_, 0);
1957   }
1958   #[inline]
add_i64_(&mut self, i64_: i64)1959   pub fn add_i64_(&mut self, i64_: i64) {
1960     self.fbb_.push_slot::<i64>(TypeAliases::VT_I64_, i64_, 0);
1961   }
1962   #[inline]
add_u64_(&mut self, u64_: u64)1963   pub fn add_u64_(&mut self, u64_: u64) {
1964     self.fbb_.push_slot::<u64>(TypeAliases::VT_U64_, u64_, 0);
1965   }
1966   #[inline]
add_f32_(&mut self, f32_: f32)1967   pub fn add_f32_(&mut self, f32_: f32) {
1968     self.fbb_.push_slot::<f32>(TypeAliases::VT_F32_, f32_, 0.0);
1969   }
1970   #[inline]
add_f64_(&mut self, f64_: f64)1971   pub fn add_f64_(&mut self, f64_: f64) {
1972     self.fbb_.push_slot::<f64>(TypeAliases::VT_F64_, f64_, 0.0);
1973   }
1974   #[inline]
add_v8(&mut self, v8: flatbuffers::WIPOffset<flatbuffers::Vector<'b , i8>>)1975   pub fn add_v8(&mut self, v8: flatbuffers::WIPOffset<flatbuffers::Vector<'b , i8>>) {
1976     self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(TypeAliases::VT_V8, v8);
1977   }
1978   #[inline]
add_vf64(&mut self, vf64: flatbuffers::WIPOffset<flatbuffers::Vector<'b , f64>>)1979   pub fn add_vf64(&mut self, vf64: flatbuffers::WIPOffset<flatbuffers::Vector<'b , f64>>) {
1980     self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(TypeAliases::VT_VF64, vf64);
1981   }
1982   #[inline]
new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> TypeAliasesBuilder<'a, 'b>1983   pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> TypeAliasesBuilder<'a, 'b> {
1984     let start = _fbb.start_table();
1985     TypeAliasesBuilder {
1986       fbb_: _fbb,
1987       start_: start,
1988     }
1989   }
1990   #[inline]
finish(self) -> flatbuffers::WIPOffset<TypeAliases<'a>>1991   pub fn finish(self) -> flatbuffers::WIPOffset<TypeAliases<'a>> {
1992     let o = self.fbb_.end_table(self.start_);
1993     flatbuffers::WIPOffset::new(o.value())
1994   }
1995 }
1996 
1997 #[inline]
get_root_as_monster<'a>(buf: &'a [u8]) -> Monster<'a>1998 pub fn get_root_as_monster<'a>(buf: &'a [u8]) -> Monster<'a> {
1999   flatbuffers::get_root::<Monster<'a>>(buf)
2000 }
2001 
2002 #[inline]
get_size_prefixed_root_as_monster<'a>(buf: &'a [u8]) -> Monster<'a>2003 pub fn get_size_prefixed_root_as_monster<'a>(buf: &'a [u8]) -> Monster<'a> {
2004   flatbuffers::get_size_prefixed_root::<Monster<'a>>(buf)
2005 }
2006 
2007 pub const MONSTER_IDENTIFIER: &'static str = "MONS";
2008 
2009 #[inline]
monster_buffer_has_identifier(buf: &[u8]) -> bool2010 pub fn monster_buffer_has_identifier(buf: &[u8]) -> bool {
2011   return flatbuffers::buffer_has_identifier(buf, MONSTER_IDENTIFIER, false);
2012 }
2013 
2014 #[inline]
monster_size_prefixed_buffer_has_identifier(buf: &[u8]) -> bool2015 pub fn monster_size_prefixed_buffer_has_identifier(buf: &[u8]) -> bool {
2016   return flatbuffers::buffer_has_identifier(buf, MONSTER_IDENTIFIER, true);
2017 }
2018 
2019 pub const MONSTER_EXTENSION: &'static str = "mon";
2020 
2021 #[inline]
finish_monster_buffer<'a, 'b>( fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>, root: flatbuffers::WIPOffset<Monster<'a>>)2022 pub fn finish_monster_buffer<'a, 'b>(
2023     fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>,
2024     root: flatbuffers::WIPOffset<Monster<'a>>) {
2025   fbb.finish(root, Some(MONSTER_IDENTIFIER));
2026 }
2027 
2028 #[inline]
finish_size_prefixed_monster_buffer<'a, 'b>(fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>, root: flatbuffers::WIPOffset<Monster<'a>>)2029 pub fn finish_size_prefixed_monster_buffer<'a, 'b>(fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>, root: flatbuffers::WIPOffset<Monster<'a>>) {
2030   fbb.finish_size_prefixed(root, Some(MONSTER_IDENTIFIER));
2031 }
2032 }  // pub mod Example
2033 }  // pub mod MyGame
2034 
2035