blob: e6539335d49b7a8066e35ca2ff1959f1050ff6cd [file] [log] [blame]
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001// automatically generated by the FlatBuffers compiler, do not modify
2
3
Austin Schuh272c6132020-11-14 16:37:52 -08004#![allow(unused_imports, dead_code)]
Austin Schuhe89fa2d2019-08-14 20:24:23 -07005
Austin Schuh272c6132020-11-14 16:37:52 -08006use crate::include_test1_generated::*;
7use crate::include_test2_generated::*;
Austin Schuhe89fa2d2019-08-14 20:24:23 -07008use std::mem;
9use std::cmp::Ordering;
10
11extern crate flatbuffers;
12use self::flatbuffers::EndianScalar;
13
14#[allow(unused_imports, dead_code)]
15pub mod my_game {
16
Austin Schuh272c6132020-11-14 16:37:52 -080017 use crate::include_test1_generated::*;
18 use crate::include_test2_generated::*;
Austin Schuhe89fa2d2019-08-14 20:24:23 -070019 use std::mem;
20 use std::cmp::Ordering;
21
22 extern crate flatbuffers;
23 use self::flatbuffers::EndianScalar;
24
25pub enum InParentNamespaceOffset {}
Austin Schuh272c6132020-11-14 16:37:52 -080026#[derive(Copy, Clone, PartialEq)]
Austin Schuhe89fa2d2019-08-14 20:24:23 -070027
28pub struct InParentNamespace<'a> {
29 pub _tab: flatbuffers::Table<'a>,
30}
31
32impl<'a> flatbuffers::Follow<'a> for InParentNamespace<'a> {
33 type Inner = InParentNamespace<'a>;
34 #[inline]
35 fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
Austin Schuh272c6132020-11-14 16:37:52 -080036 Self { _tab: flatbuffers::Table { buf, loc } }
Austin Schuhe89fa2d2019-08-14 20:24:23 -070037 }
38}
39
40impl<'a> InParentNamespace<'a> {
Austin Schuh272c6132020-11-14 16:37:52 -080041 pub const fn get_fully_qualified_name() -> &'static str {
42 "MyGame.InParentNamespace"
43 }
44
Austin Schuhe89fa2d2019-08-14 20:24:23 -070045 #[inline]
46 pub fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
47 InParentNamespace {
48 _tab: table,
49 }
50 }
51 #[allow(unused_mut)]
52 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>(
53 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>,
54 _args: &'args InParentNamespaceArgs) -> flatbuffers::WIPOffset<InParentNamespace<'bldr>> {
55 let mut builder = InParentNamespaceBuilder::new(_fbb);
56 builder.finish()
57 }
58
59}
60
61pub struct InParentNamespaceArgs {
62}
63impl<'a> Default for InParentNamespaceArgs {
64 #[inline]
65 fn default() -> Self {
66 InParentNamespaceArgs {
67 }
68 }
69}
70pub struct InParentNamespaceBuilder<'a: 'b, 'b> {
71 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a>,
72 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
73}
74impl<'a: 'b, 'b> InParentNamespaceBuilder<'a, 'b> {
75 #[inline]
76 pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> InParentNamespaceBuilder<'a, 'b> {
77 let start = _fbb.start_table();
78 InParentNamespaceBuilder {
79 fbb_: _fbb,
80 start_: start,
81 }
82 }
83 #[inline]
84 pub fn finish(self) -> flatbuffers::WIPOffset<InParentNamespace<'a>> {
85 let o = self.fbb_.end_table(self.start_);
86 flatbuffers::WIPOffset::new(o.value())
87 }
88}
89
Austin Schuh272c6132020-11-14 16:37:52 -080090impl std::fmt::Debug for InParentNamespace<'_> {
91 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
92 let mut ds = f.debug_struct("InParentNamespace");
93 ds.finish()
94 }
95}
Austin Schuhe89fa2d2019-08-14 20:24:23 -070096#[allow(unused_imports, dead_code)]
97pub mod example_2 {
98
Austin Schuh272c6132020-11-14 16:37:52 -080099 use crate::include_test1_generated::*;
100 use crate::include_test2_generated::*;
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700101 use std::mem;
102 use std::cmp::Ordering;
103
104 extern crate flatbuffers;
105 use self::flatbuffers::EndianScalar;
106
107pub enum MonsterOffset {}
Austin Schuh272c6132020-11-14 16:37:52 -0800108#[derive(Copy, Clone, PartialEq)]
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700109
110pub struct Monster<'a> {
111 pub _tab: flatbuffers::Table<'a>,
112}
113
114impl<'a> flatbuffers::Follow<'a> for Monster<'a> {
115 type Inner = Monster<'a>;
116 #[inline]
117 fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
Austin Schuh272c6132020-11-14 16:37:52 -0800118 Self { _tab: flatbuffers::Table { buf, loc } }
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700119 }
120}
121
122impl<'a> Monster<'a> {
Austin Schuh272c6132020-11-14 16:37:52 -0800123 pub const fn get_fully_qualified_name() -> &'static str {
124 "MyGame.Example2.Monster"
125 }
126
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700127 #[inline]
128 pub fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
129 Monster {
130 _tab: table,
131 }
132 }
133 #[allow(unused_mut)]
134 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>(
135 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>,
136 _args: &'args MonsterArgs) -> flatbuffers::WIPOffset<Monster<'bldr>> {
137 let mut builder = MonsterBuilder::new(_fbb);
138 builder.finish()
139 }
140
141}
142
143pub struct MonsterArgs {
144}
145impl<'a> Default for MonsterArgs {
146 #[inline]
147 fn default() -> Self {
148 MonsterArgs {
149 }
150 }
151}
152pub struct MonsterBuilder<'a: 'b, 'b> {
153 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a>,
154 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
155}
156impl<'a: 'b, 'b> MonsterBuilder<'a, 'b> {
157 #[inline]
158 pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> MonsterBuilder<'a, 'b> {
159 let start = _fbb.start_table();
160 MonsterBuilder {
161 fbb_: _fbb,
162 start_: start,
163 }
164 }
165 #[inline]
166 pub fn finish(self) -> flatbuffers::WIPOffset<Monster<'a>> {
167 let o = self.fbb_.end_table(self.start_);
168 flatbuffers::WIPOffset::new(o.value())
169 }
170}
171
Austin Schuh272c6132020-11-14 16:37:52 -0800172impl std::fmt::Debug for Monster<'_> {
173 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
174 let mut ds = f.debug_struct("Monster");
175 ds.finish()
176 }
177}
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700178} // pub mod Example2
179
180#[allow(unused_imports, dead_code)]
181pub mod example {
182
Austin Schuh272c6132020-11-14 16:37:52 -0800183 use crate::include_test1_generated::*;
184 use crate::include_test2_generated::*;
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700185 use std::mem;
186 use std::cmp::Ordering;
187
188 extern crate flatbuffers;
189 use self::flatbuffers::EndianScalar;
190
Austin Schuh272c6132020-11-14 16:37:52 -0800191#[allow(non_upper_case_globals)]
192mod bitflags_color {
193 flatbuffers::bitflags::bitflags! {
194 /// Composite components of Monster color.
195 pub struct Color: u8 {
196 const Red = 1;
197 /// \brief color Green
198 /// Green is bit_flag with value (1u << 1)
199 const Green = 2;
200 /// \brief color Blue (1u << 3)
201 const Blue = 8;
202 }
203 }
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700204}
Austin Schuh272c6132020-11-14 16:37:52 -0800205pub use self::bitflags_color::Color;
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700206
207impl<'a> flatbuffers::Follow<'a> for Color {
208 type Inner = Self;
209 #[inline]
210 fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
Austin Schuh272c6132020-11-14 16:37:52 -0800211 let bits = flatbuffers::read_scalar_at::<u8>(buf, loc);
212 unsafe { Self::from_bits_unchecked(bits) }
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700213 }
214}
215
216impl flatbuffers::Push for Color {
217 type Output = Color;
218 #[inline]
219 fn push(&self, dst: &mut [u8], _rest: &[u8]) {
Austin Schuh272c6132020-11-14 16:37:52 -0800220 flatbuffers::emplace_scalar::<u8>(dst, self.bits());
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700221 }
222}
223
Austin Schuh272c6132020-11-14 16:37:52 -0800224impl flatbuffers::EndianScalar for Color {
225 #[inline]
226 fn to_little_endian(self) -> Self {
227 let bits = u8::to_le(self.bits());
228 unsafe { Self::from_bits_unchecked(bits) }
229 }
230 #[inline]
231 fn from_little_endian(self) -> Self {
232 let bits = u8::from_le(self.bits());
233 unsafe { Self::from_bits_unchecked(bits) }
234 }
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700235}
236
Austin Schuh272c6132020-11-14 16:37:52 -0800237#[deprecated(since = "1.13", note = "Use associated constants instead. This will no longer be generated in 2021.")]
238pub const ENUM_MIN_RACE: i8 = -1;
239#[deprecated(since = "1.13", note = "Use associated constants instead. This will no longer be generated in 2021.")]
240pub const ENUM_MAX_RACE: i8 = 2;
241#[deprecated(since = "1.13", note = "Use associated constants instead. This will no longer be generated in 2021.")]
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700242#[allow(non_camel_case_types)]
Austin Schuh272c6132020-11-14 16:37:52 -0800243pub const ENUM_VALUES_RACE: [Race; 4] = [
244 Race::None,
245 Race::Human,
246 Race::Dwarf,
247 Race::Elf,
248];
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700249
Austin Schuh272c6132020-11-14 16:37:52 -0800250#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
251#[repr(transparent)]
252pub struct Race(pub i8);
253#[allow(non_upper_case_globals)]
254impl Race {
255 pub const None: Self = Self(-1);
256 pub const Human: Self = Self(0);
257 pub const Dwarf: Self = Self(1);
258 pub const Elf: Self = Self(2);
259
260 pub const ENUM_MIN: i8 = -1;
261 pub const ENUM_MAX: i8 = 2;
262 pub const ENUM_VALUES: &'static [Self] = &[
263 Self::None,
264 Self::Human,
265 Self::Dwarf,
266 Self::Elf,
267 ];
268 /// Returns the variant's name or "" if unknown.
269 pub fn variant_name(self) -> Option<&'static str> {
270 match self {
271 Self::None => Some("None"),
272 Self::Human => Some("Human"),
273 Self::Dwarf => Some("Dwarf"),
274 Self::Elf => Some("Elf"),
275 _ => None,
276 }
277 }
278}
279impl std::fmt::Debug for Race {
280 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
281 if let Some(name) = self.variant_name() {
282 f.write_str(name)
283 } else {
284 f.write_fmt(format_args!("<UNKNOWN {:?}>", self.0))
285 }
286 }
287}
288impl<'a> flatbuffers::Follow<'a> for Race {
289 type Inner = Self;
290 #[inline]
291 fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
292 Self(flatbuffers::read_scalar_at::<i8>(buf, loc))
293 }
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700294}
295
Austin Schuh272c6132020-11-14 16:37:52 -0800296impl flatbuffers::Push for Race {
297 type Output = Race;
298 #[inline]
299 fn push(&self, dst: &mut [u8], _rest: &[u8]) {
300 flatbuffers::emplace_scalar::<i8>(dst, self.0);
301 }
302}
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700303
Austin Schuh272c6132020-11-14 16:37:52 -0800304impl flatbuffers::EndianScalar for Race {
305 #[inline]
306 fn to_little_endian(self) -> Self {
307 Self(i8::to_le(self.0))
308 }
309 #[inline]
310 fn from_little_endian(self) -> Self {
311 Self(i8::from_le(self.0))
312 }
313}
314
315#[deprecated(since = "1.13", note = "Use associated constants instead. This will no longer be generated in 2021.")]
316pub const ENUM_MIN_ANY: u8 = 0;
317#[deprecated(since = "1.13", note = "Use associated constants instead. This will no longer be generated in 2021.")]
318pub const ENUM_MAX_ANY: u8 = 3;
319#[deprecated(since = "1.13", note = "Use associated constants instead. This will no longer be generated in 2021.")]
320#[allow(non_camel_case_types)]
321pub const ENUM_VALUES_ANY: [Any; 4] = [
322 Any::NONE,
323 Any::Monster,
324 Any::TestSimpleTableWithEnum,
325 Any::MyGame_Example2_Monster,
326];
327
328#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
329#[repr(transparent)]
330pub struct Any(pub u8);
331#[allow(non_upper_case_globals)]
332impl Any {
333 pub const NONE: Self = Self(0);
334 pub const Monster: Self = Self(1);
335 pub const TestSimpleTableWithEnum: Self = Self(2);
336 pub const MyGame_Example2_Monster: Self = Self(3);
337
338 pub const ENUM_MIN: u8 = 0;
339 pub const ENUM_MAX: u8 = 3;
340 pub const ENUM_VALUES: &'static [Self] = &[
341 Self::NONE,
342 Self::Monster,
343 Self::TestSimpleTableWithEnum,
344 Self::MyGame_Example2_Monster,
345 ];
346 /// Returns the variant's name or "" if unknown.
347 pub fn variant_name(self) -> Option<&'static str> {
348 match self {
349 Self::NONE => Some("NONE"),
350 Self::Monster => Some("Monster"),
351 Self::TestSimpleTableWithEnum => Some("TestSimpleTableWithEnum"),
352 Self::MyGame_Example2_Monster => Some("MyGame_Example2_Monster"),
353 _ => None,
354 }
355 }
356}
357impl std::fmt::Debug for Any {
358 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
359 if let Some(name) = self.variant_name() {
360 f.write_str(name)
361 } else {
362 f.write_fmt(format_args!("<UNKNOWN {:?}>", self.0))
363 }
364 }
365}
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700366impl<'a> flatbuffers::Follow<'a> for Any {
367 type Inner = Self;
368 #[inline]
369 fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
Austin Schuh272c6132020-11-14 16:37:52 -0800370 Self(flatbuffers::read_scalar_at::<u8>(buf, loc))
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700371 }
372}
373
374impl flatbuffers::Push for Any {
375 type Output = Any;
376 #[inline]
377 fn push(&self, dst: &mut [u8], _rest: &[u8]) {
Austin Schuh272c6132020-11-14 16:37:52 -0800378 flatbuffers::emplace_scalar::<u8>(dst, self.0);
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700379 }
380}
381
Austin Schuh272c6132020-11-14 16:37:52 -0800382impl flatbuffers::EndianScalar for Any {
383 #[inline]
384 fn to_little_endian(self) -> Self {
385 Self(u8::to_le(self.0))
386 }
387 #[inline]
388 fn from_little_endian(self) -> Self {
389 Self(u8::from_le(self.0))
390 }
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700391}
392
393pub struct AnyUnionTableOffset {}
Austin Schuh272c6132020-11-14 16:37:52 -0800394#[deprecated(since = "1.13", note = "Use associated constants instead. This will no longer be generated in 2021.")]
395pub const ENUM_MIN_ANY_UNIQUE_ALIASES: u8 = 0;
396#[deprecated(since = "1.13", note = "Use associated constants instead. This will no longer be generated in 2021.")]
397pub const ENUM_MAX_ANY_UNIQUE_ALIASES: u8 = 3;
398#[deprecated(since = "1.13", note = "Use associated constants instead. This will no longer be generated in 2021.")]
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700399#[allow(non_camel_case_types)]
Austin Schuh272c6132020-11-14 16:37:52 -0800400pub const ENUM_VALUES_ANY_UNIQUE_ALIASES: [AnyUniqueAliases; 4] = [
401 AnyUniqueAliases::NONE,
402 AnyUniqueAliases::M,
403 AnyUniqueAliases::TS,
404 AnyUniqueAliases::M2,
405];
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700406
Austin Schuh272c6132020-11-14 16:37:52 -0800407#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
408#[repr(transparent)]
409pub struct AnyUniqueAliases(pub u8);
410#[allow(non_upper_case_globals)]
411impl AnyUniqueAliases {
412 pub const NONE: Self = Self(0);
413 pub const M: Self = Self(1);
414 pub const TS: Self = Self(2);
415 pub const M2: Self = Self(3);
416
417 pub const ENUM_MIN: u8 = 0;
418 pub const ENUM_MAX: u8 = 3;
419 pub const ENUM_VALUES: &'static [Self] = &[
420 Self::NONE,
421 Self::M,
422 Self::TS,
423 Self::M2,
424 ];
425 /// Returns the variant's name or "" if unknown.
426 pub fn variant_name(self) -> Option<&'static str> {
427 match self {
428 Self::NONE => Some("NONE"),
429 Self::M => Some("M"),
430 Self::TS => Some("TS"),
431 Self::M2 => Some("M2"),
432 _ => None,
433 }
434 }
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700435}
Austin Schuh272c6132020-11-14 16:37:52 -0800436impl std::fmt::Debug for AnyUniqueAliases {
437 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
438 if let Some(name) = self.variant_name() {
439 f.write_str(name)
440 } else {
441 f.write_fmt(format_args!("<UNKNOWN {:?}>", self.0))
442 }
443 }
444}
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700445impl<'a> flatbuffers::Follow<'a> for AnyUniqueAliases {
446 type Inner = Self;
447 #[inline]
448 fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
Austin Schuh272c6132020-11-14 16:37:52 -0800449 Self(flatbuffers::read_scalar_at::<u8>(buf, loc))
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700450 }
451}
452
453impl flatbuffers::Push for AnyUniqueAliases {
454 type Output = AnyUniqueAliases;
455 #[inline]
456 fn push(&self, dst: &mut [u8], _rest: &[u8]) {
Austin Schuh272c6132020-11-14 16:37:52 -0800457 flatbuffers::emplace_scalar::<u8>(dst, self.0);
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700458 }
459}
460
Austin Schuh272c6132020-11-14 16:37:52 -0800461impl flatbuffers::EndianScalar for AnyUniqueAliases {
462 #[inline]
463 fn to_little_endian(self) -> Self {
464 Self(u8::to_le(self.0))
465 }
466 #[inline]
467 fn from_little_endian(self) -> Self {
468 Self(u8::from_le(self.0))
469 }
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700470}
471
472pub struct AnyUniqueAliasesUnionTableOffset {}
Austin Schuh272c6132020-11-14 16:37:52 -0800473#[deprecated(since = "1.13", note = "Use associated constants instead. This will no longer be generated in 2021.")]
474pub const ENUM_MIN_ANY_AMBIGUOUS_ALIASES: u8 = 0;
475#[deprecated(since = "1.13", note = "Use associated constants instead. This will no longer be generated in 2021.")]
476pub const ENUM_MAX_ANY_AMBIGUOUS_ALIASES: u8 = 3;
477#[deprecated(since = "1.13", note = "Use associated constants instead. This will no longer be generated in 2021.")]
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700478#[allow(non_camel_case_types)]
Austin Schuh272c6132020-11-14 16:37:52 -0800479pub const ENUM_VALUES_ANY_AMBIGUOUS_ALIASES: [AnyAmbiguousAliases; 4] = [
480 AnyAmbiguousAliases::NONE,
481 AnyAmbiguousAliases::M1,
482 AnyAmbiguousAliases::M2,
483 AnyAmbiguousAliases::M3,
484];
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700485
Austin Schuh272c6132020-11-14 16:37:52 -0800486#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
487#[repr(transparent)]
488pub struct AnyAmbiguousAliases(pub u8);
489#[allow(non_upper_case_globals)]
490impl AnyAmbiguousAliases {
491 pub const NONE: Self = Self(0);
492 pub const M1: Self = Self(1);
493 pub const M2: Self = Self(2);
494 pub const M3: Self = Self(3);
495
496 pub const ENUM_MIN: u8 = 0;
497 pub const ENUM_MAX: u8 = 3;
498 pub const ENUM_VALUES: &'static [Self] = &[
499 Self::NONE,
500 Self::M1,
501 Self::M2,
502 Self::M3,
503 ];
504 /// Returns the variant's name or "" if unknown.
505 pub fn variant_name(self) -> Option<&'static str> {
506 match self {
507 Self::NONE => Some("NONE"),
508 Self::M1 => Some("M1"),
509 Self::M2 => Some("M2"),
510 Self::M3 => Some("M3"),
511 _ => None,
512 }
513 }
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700514}
Austin Schuh272c6132020-11-14 16:37:52 -0800515impl std::fmt::Debug for AnyAmbiguousAliases {
516 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
517 if let Some(name) = self.variant_name() {
518 f.write_str(name)
519 } else {
520 f.write_fmt(format_args!("<UNKNOWN {:?}>", self.0))
521 }
522 }
523}
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700524impl<'a> flatbuffers::Follow<'a> for AnyAmbiguousAliases {
525 type Inner = Self;
526 #[inline]
527 fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
Austin Schuh272c6132020-11-14 16:37:52 -0800528 Self(flatbuffers::read_scalar_at::<u8>(buf, loc))
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700529 }
530}
531
532impl flatbuffers::Push for AnyAmbiguousAliases {
533 type Output = AnyAmbiguousAliases;
534 #[inline]
535 fn push(&self, dst: &mut [u8], _rest: &[u8]) {
Austin Schuh272c6132020-11-14 16:37:52 -0800536 flatbuffers::emplace_scalar::<u8>(dst, self.0);
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700537 }
538}
539
Austin Schuh272c6132020-11-14 16:37:52 -0800540impl flatbuffers::EndianScalar for AnyAmbiguousAliases {
541 #[inline]
542 fn to_little_endian(self) -> Self {
543 Self(u8::to_le(self.0))
544 }
545 #[inline]
546 fn from_little_endian(self) -> Self {
547 Self(u8::from_le(self.0))
548 }
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700549}
550
551pub struct AnyAmbiguousAliasesUnionTableOffset {}
552// struct Test, aligned to 2
553#[repr(C, align(2))]
Austin Schuh272c6132020-11-14 16:37:52 -0800554#[derive(Clone, Copy, PartialEq)]
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700555pub struct Test {
556 a_: i16,
557 b_: i8,
558 padding0__: u8,
559} // pub struct Test
Austin Schuh272c6132020-11-14 16:37:52 -0800560impl std::fmt::Debug for Test {
561 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
562 f.debug_struct("Test")
563 .field("a", &self.a())
564 .field("b", &self.b())
565 .finish()
566 }
567}
568
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700569impl flatbuffers::SafeSliceAccess for Test {}
570impl<'a> flatbuffers::Follow<'a> for Test {
571 type Inner = &'a Test;
572 #[inline]
573 fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
574 <&'a Test>::follow(buf, loc)
575 }
576}
577impl<'a> flatbuffers::Follow<'a> for &'a Test {
578 type Inner = &'a Test;
579 #[inline]
580 fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
581 flatbuffers::follow_cast_ref::<Test>(buf, loc)
582 }
583}
584impl<'b> flatbuffers::Push for Test {
585 type Output = Test;
586 #[inline]
587 fn push(&self, dst: &mut [u8], _rest: &[u8]) {
588 let src = unsafe {
589 ::std::slice::from_raw_parts(self as *const Test as *const u8, Self::size())
590 };
591 dst.copy_from_slice(src);
592 }
593}
594impl<'b> flatbuffers::Push for &'b Test {
595 type Output = Test;
596
597 #[inline]
598 fn push(&self, dst: &mut [u8], _rest: &[u8]) {
599 let src = unsafe {
600 ::std::slice::from_raw_parts(*self as *const Test as *const u8, Self::size())
601 };
602 dst.copy_from_slice(src);
603 }
604}
605
606
607impl Test {
Austin Schuh272c6132020-11-14 16:37:52 -0800608 pub fn new(_a: i16, _b: i8) -> Self {
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700609 Test {
610 a_: _a.to_little_endian(),
611 b_: _b.to_little_endian(),
612
613 padding0__: 0,
614 }
615 }
Austin Schuh272c6132020-11-14 16:37:52 -0800616 pub const fn get_fully_qualified_name() -> &'static str {
617 "MyGame.Example.Test"
618 }
619
620 pub fn a(&self) -> i16 {
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700621 self.a_.from_little_endian()
622 }
Austin Schuh272c6132020-11-14 16:37:52 -0800623 pub fn b(&self) -> i8 {
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700624 self.b_.from_little_endian()
625 }
626}
627
628// struct Vec3, aligned to 8
629#[repr(C, align(8))]
Austin Schuh272c6132020-11-14 16:37:52 -0800630#[derive(Clone, Copy, PartialEq)]
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700631pub struct Vec3 {
632 x_: f32,
633 y_: f32,
634 z_: f32,
635 padding0__: u32,
636 test1_: f64,
637 test2_: Color,
638 padding1__: u8,
639 test3_: Test,
640 padding2__: u16,
641} // pub struct Vec3
Austin Schuh272c6132020-11-14 16:37:52 -0800642impl std::fmt::Debug for Vec3 {
643 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
644 f.debug_struct("Vec3")
645 .field("x", &self.x())
646 .field("y", &self.y())
647 .field("z", &self.z())
648 .field("test1", &self.test1())
649 .field("test2", &self.test2())
650 .field("test3", &self.test3())
651 .finish()
652 }
653}
654
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700655impl flatbuffers::SafeSliceAccess for Vec3 {}
656impl<'a> flatbuffers::Follow<'a> for Vec3 {
657 type Inner = &'a Vec3;
658 #[inline]
659 fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
660 <&'a Vec3>::follow(buf, loc)
661 }
662}
663impl<'a> flatbuffers::Follow<'a> for &'a Vec3 {
664 type Inner = &'a Vec3;
665 #[inline]
666 fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
667 flatbuffers::follow_cast_ref::<Vec3>(buf, loc)
668 }
669}
670impl<'b> flatbuffers::Push for Vec3 {
671 type Output = Vec3;
672 #[inline]
673 fn push(&self, dst: &mut [u8], _rest: &[u8]) {
674 let src = unsafe {
675 ::std::slice::from_raw_parts(self as *const Vec3 as *const u8, Self::size())
676 };
677 dst.copy_from_slice(src);
678 }
679}
680impl<'b> flatbuffers::Push for &'b Vec3 {
681 type Output = Vec3;
682
683 #[inline]
684 fn push(&self, dst: &mut [u8], _rest: &[u8]) {
685 let src = unsafe {
686 ::std::slice::from_raw_parts(*self as *const Vec3 as *const u8, Self::size())
687 };
688 dst.copy_from_slice(src);
689 }
690}
691
692
693impl Vec3 {
Austin Schuh272c6132020-11-14 16:37:52 -0800694 pub fn new(_x: f32, _y: f32, _z: f32, _test1: f64, _test2: Color, _test3: &Test) -> Self {
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700695 Vec3 {
696 x_: _x.to_little_endian(),
697 y_: _y.to_little_endian(),
698 z_: _z.to_little_endian(),
699 test1_: _test1.to_little_endian(),
700 test2_: _test2.to_little_endian(),
701 test3_: *_test3,
702
703 padding0__: 0,
704 padding1__: 0,
705 padding2__: 0,
706 }
707 }
Austin Schuh272c6132020-11-14 16:37:52 -0800708 pub const fn get_fully_qualified_name() -> &'static str {
709 "MyGame.Example.Vec3"
710 }
711
712 pub fn x(&self) -> f32 {
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700713 self.x_.from_little_endian()
714 }
Austin Schuh272c6132020-11-14 16:37:52 -0800715 pub fn y(&self) -> f32 {
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700716 self.y_.from_little_endian()
717 }
Austin Schuh272c6132020-11-14 16:37:52 -0800718 pub fn z(&self) -> f32 {
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700719 self.z_.from_little_endian()
720 }
Austin Schuh272c6132020-11-14 16:37:52 -0800721 pub fn test1(&self) -> f64 {
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700722 self.test1_.from_little_endian()
723 }
Austin Schuh272c6132020-11-14 16:37:52 -0800724 pub fn test2(&self) -> Color {
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700725 self.test2_.from_little_endian()
726 }
Austin Schuh272c6132020-11-14 16:37:52 -0800727 pub fn test3(&self) -> &Test {
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700728 &self.test3_
729 }
730}
731
732// struct Ability, aligned to 4
733#[repr(C, align(4))]
Austin Schuh272c6132020-11-14 16:37:52 -0800734#[derive(Clone, Copy, PartialEq)]
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700735pub struct Ability {
736 id_: u32,
737 distance_: u32,
738} // pub struct Ability
Austin Schuh272c6132020-11-14 16:37:52 -0800739impl std::fmt::Debug for Ability {
740 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
741 f.debug_struct("Ability")
742 .field("id", &self.id())
743 .field("distance", &self.distance())
744 .finish()
745 }
746}
747
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700748impl flatbuffers::SafeSliceAccess for Ability {}
749impl<'a> flatbuffers::Follow<'a> for Ability {
750 type Inner = &'a Ability;
751 #[inline]
752 fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
753 <&'a Ability>::follow(buf, loc)
754 }
755}
756impl<'a> flatbuffers::Follow<'a> for &'a Ability {
757 type Inner = &'a Ability;
758 #[inline]
759 fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
760 flatbuffers::follow_cast_ref::<Ability>(buf, loc)
761 }
762}
763impl<'b> flatbuffers::Push for Ability {
764 type Output = Ability;
765 #[inline]
766 fn push(&self, dst: &mut [u8], _rest: &[u8]) {
767 let src = unsafe {
768 ::std::slice::from_raw_parts(self as *const Ability as *const u8, Self::size())
769 };
770 dst.copy_from_slice(src);
771 }
772}
773impl<'b> flatbuffers::Push for &'b Ability {
774 type Output = Ability;
775
776 #[inline]
777 fn push(&self, dst: &mut [u8], _rest: &[u8]) {
778 let src = unsafe {
779 ::std::slice::from_raw_parts(*self as *const Ability as *const u8, Self::size())
780 };
781 dst.copy_from_slice(src);
782 }
783}
784
785
786impl Ability {
Austin Schuh272c6132020-11-14 16:37:52 -0800787 pub fn new(_id: u32, _distance: u32) -> Self {
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700788 Ability {
789 id_: _id.to_little_endian(),
790 distance_: _distance.to_little_endian(),
791
792 }
793 }
Austin Schuh272c6132020-11-14 16:37:52 -0800794 pub const fn get_fully_qualified_name() -> &'static str {
795 "MyGame.Example.Ability"
796 }
797
798 pub fn id(&self) -> u32 {
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700799 self.id_.from_little_endian()
800 }
801 #[inline]
802 pub fn key_compare_less_than(&self, o: &Ability) -> bool {
803 self.id() < o.id()
804 }
805
806 #[inline]
807 pub fn key_compare_with_value(&self, val: u32) -> ::std::cmp::Ordering {
808 let key = self.id();
809 key.cmp(&val)
810 }
Austin Schuh272c6132020-11-14 16:37:52 -0800811 pub fn distance(&self) -> u32 {
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700812 self.distance_.from_little_endian()
813 }
814}
815
816pub enum TestSimpleTableWithEnumOffset {}
Austin Schuh272c6132020-11-14 16:37:52 -0800817#[derive(Copy, Clone, PartialEq)]
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700818
819pub struct TestSimpleTableWithEnum<'a> {
820 pub _tab: flatbuffers::Table<'a>,
821}
822
823impl<'a> flatbuffers::Follow<'a> for TestSimpleTableWithEnum<'a> {
824 type Inner = TestSimpleTableWithEnum<'a>;
825 #[inline]
826 fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
Austin Schuh272c6132020-11-14 16:37:52 -0800827 Self { _tab: flatbuffers::Table { buf, loc } }
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700828 }
829}
830
831impl<'a> TestSimpleTableWithEnum<'a> {
Austin Schuh272c6132020-11-14 16:37:52 -0800832 pub const fn get_fully_qualified_name() -> &'static str {
833 "MyGame.Example.TestSimpleTableWithEnum"
834 }
835
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700836 #[inline]
837 pub fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
838 TestSimpleTableWithEnum {
839 _tab: table,
840 }
841 }
842 #[allow(unused_mut)]
843 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>(
844 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>,
845 args: &'args TestSimpleTableWithEnumArgs) -> flatbuffers::WIPOffset<TestSimpleTableWithEnum<'bldr>> {
846 let mut builder = TestSimpleTableWithEnumBuilder::new(_fbb);
847 builder.add_color(args.color);
848 builder.finish()
849 }
850
851 pub const VT_COLOR: flatbuffers::VOffsetT = 4;
852
853 #[inline]
854 pub fn color(&self) -> Color {
855 self._tab.get::<Color>(TestSimpleTableWithEnum::VT_COLOR, Some(Color::Green)).unwrap()
856 }
857}
858
859pub struct TestSimpleTableWithEnumArgs {
860 pub color: Color,
861}
862impl<'a> Default for TestSimpleTableWithEnumArgs {
863 #[inline]
864 fn default() -> Self {
865 TestSimpleTableWithEnumArgs {
866 color: Color::Green,
867 }
868 }
869}
870pub struct TestSimpleTableWithEnumBuilder<'a: 'b, 'b> {
871 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a>,
872 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
873}
874impl<'a: 'b, 'b> TestSimpleTableWithEnumBuilder<'a, 'b> {
875 #[inline]
876 pub fn add_color(&mut self, color: Color) {
877 self.fbb_.push_slot::<Color>(TestSimpleTableWithEnum::VT_COLOR, color, Color::Green);
878 }
879 #[inline]
880 pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> TestSimpleTableWithEnumBuilder<'a, 'b> {
881 let start = _fbb.start_table();
882 TestSimpleTableWithEnumBuilder {
883 fbb_: _fbb,
884 start_: start,
885 }
886 }
887 #[inline]
888 pub fn finish(self) -> flatbuffers::WIPOffset<TestSimpleTableWithEnum<'a>> {
889 let o = self.fbb_.end_table(self.start_);
890 flatbuffers::WIPOffset::new(o.value())
891 }
892}
893
Austin Schuh272c6132020-11-14 16:37:52 -0800894impl std::fmt::Debug for TestSimpleTableWithEnum<'_> {
895 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
896 let mut ds = f.debug_struct("TestSimpleTableWithEnum");
897 ds.field("color", &self.color());
898 ds.finish()
899 }
900}
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700901pub enum StatOffset {}
Austin Schuh272c6132020-11-14 16:37:52 -0800902#[derive(Copy, Clone, PartialEq)]
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700903
904pub struct Stat<'a> {
905 pub _tab: flatbuffers::Table<'a>,
906}
907
908impl<'a> flatbuffers::Follow<'a> for Stat<'a> {
909 type Inner = Stat<'a>;
910 #[inline]
911 fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
Austin Schuh272c6132020-11-14 16:37:52 -0800912 Self { _tab: flatbuffers::Table { buf, loc } }
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700913 }
914}
915
916impl<'a> Stat<'a> {
Austin Schuh272c6132020-11-14 16:37:52 -0800917 pub const fn get_fully_qualified_name() -> &'static str {
918 "MyGame.Example.Stat"
919 }
920
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700921 #[inline]
922 pub fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
923 Stat {
924 _tab: table,
925 }
926 }
927 #[allow(unused_mut)]
928 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>(
929 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>,
930 args: &'args StatArgs<'args>) -> flatbuffers::WIPOffset<Stat<'bldr>> {
931 let mut builder = StatBuilder::new(_fbb);
932 builder.add_val(args.val);
933 if let Some(x) = args.id { builder.add_id(x); }
934 builder.add_count(args.count);
935 builder.finish()
936 }
937
938 pub const VT_ID: flatbuffers::VOffsetT = 4;
939 pub const VT_VAL: flatbuffers::VOffsetT = 6;
940 pub const VT_COUNT: flatbuffers::VOffsetT = 8;
941
942 #[inline]
943 pub fn id(&self) -> Option<&'a str> {
944 self._tab.get::<flatbuffers::ForwardsUOffset<&str>>(Stat::VT_ID, None)
945 }
946 #[inline]
947 pub fn val(&self) -> i64 {
948 self._tab.get::<i64>(Stat::VT_VAL, Some(0)).unwrap()
949 }
950 #[inline]
951 pub fn count(&self) -> u16 {
952 self._tab.get::<u16>(Stat::VT_COUNT, Some(0)).unwrap()
953 }
954}
955
956pub struct StatArgs<'a> {
Austin Schuh272c6132020-11-14 16:37:52 -0800957 pub id: Option<flatbuffers::WIPOffset<&'a str>>,
Austin Schuhe89fa2d2019-08-14 20:24:23 -0700958 pub val: i64,
959 pub count: u16,
960}
961impl<'a> Default for StatArgs<'a> {
962 #[inline]
963 fn default() -> Self {
964 StatArgs {
965 id: None,
966 val: 0,
967 count: 0,
968 }
969 }
970}
971pub struct StatBuilder<'a: 'b, 'b> {
972 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a>,
973 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
974}
975impl<'a: 'b, 'b> StatBuilder<'a, 'b> {
976 #[inline]
977 pub fn add_id(&mut self, id: flatbuffers::WIPOffset<&'b str>) {
978 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Stat::VT_ID, id);
979 }
980 #[inline]
981 pub fn add_val(&mut self, val: i64) {
982 self.fbb_.push_slot::<i64>(Stat::VT_VAL, val, 0);
983 }
984 #[inline]
985 pub fn add_count(&mut self, count: u16) {
986 self.fbb_.push_slot::<u16>(Stat::VT_COUNT, count, 0);
987 }
988 #[inline]
989 pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> StatBuilder<'a, 'b> {
990 let start = _fbb.start_table();
991 StatBuilder {
992 fbb_: _fbb,
993 start_: start,
994 }
995 }
996 #[inline]
997 pub fn finish(self) -> flatbuffers::WIPOffset<Stat<'a>> {
998 let o = self.fbb_.end_table(self.start_);
999 flatbuffers::WIPOffset::new(o.value())
1000 }
1001}
1002
Austin Schuh272c6132020-11-14 16:37:52 -08001003impl std::fmt::Debug for Stat<'_> {
1004 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1005 let mut ds = f.debug_struct("Stat");
1006 ds.field("id", &self.id());
1007 ds.field("val", &self.val());
1008 ds.field("count", &self.count());
1009 ds.finish()
1010 }
1011}
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001012pub enum ReferrableOffset {}
Austin Schuh272c6132020-11-14 16:37:52 -08001013#[derive(Copy, Clone, PartialEq)]
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001014
1015pub struct Referrable<'a> {
1016 pub _tab: flatbuffers::Table<'a>,
1017}
1018
1019impl<'a> flatbuffers::Follow<'a> for Referrable<'a> {
1020 type Inner = Referrable<'a>;
1021 #[inline]
1022 fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
Austin Schuh272c6132020-11-14 16:37:52 -08001023 Self { _tab: flatbuffers::Table { buf, loc } }
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001024 }
1025}
1026
1027impl<'a> Referrable<'a> {
Austin Schuh272c6132020-11-14 16:37:52 -08001028 pub const fn get_fully_qualified_name() -> &'static str {
1029 "MyGame.Example.Referrable"
1030 }
1031
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001032 #[inline]
1033 pub fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
1034 Referrable {
1035 _tab: table,
1036 }
1037 }
1038 #[allow(unused_mut)]
1039 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>(
1040 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>,
1041 args: &'args ReferrableArgs) -> flatbuffers::WIPOffset<Referrable<'bldr>> {
1042 let mut builder = ReferrableBuilder::new(_fbb);
1043 builder.add_id(args.id);
1044 builder.finish()
1045 }
1046
1047 pub const VT_ID: flatbuffers::VOffsetT = 4;
1048
1049 #[inline]
1050 pub fn id(&self) -> u64 {
1051 self._tab.get::<u64>(Referrable::VT_ID, Some(0)).unwrap()
1052 }
1053 #[inline]
1054 pub fn key_compare_less_than(&self, o: &Referrable) -> bool {
1055 self.id() < o.id()
1056 }
1057
1058 #[inline]
1059 pub fn key_compare_with_value(&self, val: u64) -> ::std::cmp::Ordering {
1060 let key = self.id();
1061 key.cmp(&val)
1062 }
1063}
1064
1065pub struct ReferrableArgs {
1066 pub id: u64,
1067}
1068impl<'a> Default for ReferrableArgs {
1069 #[inline]
1070 fn default() -> Self {
1071 ReferrableArgs {
1072 id: 0,
1073 }
1074 }
1075}
1076pub struct ReferrableBuilder<'a: 'b, 'b> {
1077 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a>,
1078 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
1079}
1080impl<'a: 'b, 'b> ReferrableBuilder<'a, 'b> {
1081 #[inline]
1082 pub fn add_id(&mut self, id: u64) {
1083 self.fbb_.push_slot::<u64>(Referrable::VT_ID, id, 0);
1084 }
1085 #[inline]
1086 pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> ReferrableBuilder<'a, 'b> {
1087 let start = _fbb.start_table();
1088 ReferrableBuilder {
1089 fbb_: _fbb,
1090 start_: start,
1091 }
1092 }
1093 #[inline]
1094 pub fn finish(self) -> flatbuffers::WIPOffset<Referrable<'a>> {
1095 let o = self.fbb_.end_table(self.start_);
1096 flatbuffers::WIPOffset::new(o.value())
1097 }
1098}
1099
Austin Schuh272c6132020-11-14 16:37:52 -08001100impl std::fmt::Debug for Referrable<'_> {
1101 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1102 let mut ds = f.debug_struct("Referrable");
1103 ds.field("id", &self.id());
1104 ds.finish()
1105 }
1106}
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001107pub enum MonsterOffset {}
Austin Schuh272c6132020-11-14 16:37:52 -08001108#[derive(Copy, Clone, PartialEq)]
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001109
Austin Schuh272c6132020-11-14 16:37:52 -08001110/// an example documentation comment: "monster object"
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001111pub struct Monster<'a> {
1112 pub _tab: flatbuffers::Table<'a>,
1113}
1114
1115impl<'a> flatbuffers::Follow<'a> for Monster<'a> {
1116 type Inner = Monster<'a>;
1117 #[inline]
1118 fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
Austin Schuh272c6132020-11-14 16:37:52 -08001119 Self { _tab: flatbuffers::Table { buf, loc } }
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001120 }
1121}
1122
1123impl<'a> Monster<'a> {
Austin Schuh272c6132020-11-14 16:37:52 -08001124 pub const fn get_fully_qualified_name() -> &'static str {
1125 "MyGame.Example.Monster"
1126 }
1127
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001128 #[inline]
1129 pub fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
1130 Monster {
1131 _tab: table,
1132 }
1133 }
1134 #[allow(unused_mut)]
1135 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>(
1136 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>,
1137 args: &'args MonsterArgs<'args>) -> flatbuffers::WIPOffset<Monster<'bldr>> {
1138 let mut builder = MonsterBuilder::new(_fbb);
1139 builder.add_non_owning_reference(args.non_owning_reference);
1140 builder.add_co_owning_reference(args.co_owning_reference);
1141 builder.add_single_weak_reference(args.single_weak_reference);
1142 builder.add_testhashu64_fnv1a(args.testhashu64_fnv1a);
1143 builder.add_testhashs64_fnv1a(args.testhashs64_fnv1a);
1144 builder.add_testhashu64_fnv1(args.testhashu64_fnv1);
1145 builder.add_testhashs64_fnv1(args.testhashs64_fnv1);
Austin Schuh272c6132020-11-14 16:37:52 -08001146 if let Some(x) = args.testrequirednestedflatbuffer { builder.add_testrequirednestedflatbuffer(x); }
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001147 if let Some(x) = args.vector_of_enums { builder.add_vector_of_enums(x); }
1148 if let Some(x) = args.any_ambiguous { builder.add_any_ambiguous(x); }
1149 if let Some(x) = args.any_unique { builder.add_any_unique(x); }
1150 if let Some(x) = args.vector_of_non_owning_references { builder.add_vector_of_non_owning_references(x); }
1151 if let Some(x) = args.vector_of_co_owning_references { builder.add_vector_of_co_owning_references(x); }
1152 if let Some(x) = args.vector_of_strong_referrables { builder.add_vector_of_strong_referrables(x); }
1153 if let Some(x) = args.vector_of_weak_references { builder.add_vector_of_weak_references(x); }
1154 if let Some(x) = args.vector_of_referrables { builder.add_vector_of_referrables(x); }
1155 if let Some(x) = args.parent_namespace_test { builder.add_parent_namespace_test(x); }
1156 if let Some(x) = args.vector_of_doubles { builder.add_vector_of_doubles(x); }
1157 if let Some(x) = args.vector_of_longs { builder.add_vector_of_longs(x); }
1158 if let Some(x) = args.test5 { builder.add_test5(x); }
1159 if let Some(x) = args.flex { builder.add_flex(x); }
1160 if let Some(x) = args.testarrayofsortedstruct { builder.add_testarrayofsortedstruct(x); }
1161 if let Some(x) = args.testarrayofstring2 { builder.add_testarrayofstring2(x); }
1162 builder.add_testf3(args.testf3);
1163 builder.add_testf2(args.testf2);
1164 builder.add_testf(args.testf);
1165 if let Some(x) = args.testarrayofbools { builder.add_testarrayofbools(x); }
1166 builder.add_testhashu32_fnv1a(args.testhashu32_fnv1a);
1167 builder.add_testhashs32_fnv1a(args.testhashs32_fnv1a);
1168 builder.add_testhashu32_fnv1(args.testhashu32_fnv1);
1169 builder.add_testhashs32_fnv1(args.testhashs32_fnv1);
1170 if let Some(x) = args.testempty { builder.add_testempty(x); }
1171 if let Some(x) = args.testnestedflatbuffer { builder.add_testnestedflatbuffer(x); }
1172 if let Some(x) = args.enemy { builder.add_enemy(x); }
1173 if let Some(x) = args.testarrayoftables { builder.add_testarrayoftables(x); }
1174 if let Some(x) = args.testarrayofstring { builder.add_testarrayofstring(x); }
1175 if let Some(x) = args.test4 { builder.add_test4(x); }
1176 if let Some(x) = args.test { builder.add_test(x); }
1177 if let Some(x) = args.inventory { builder.add_inventory(x); }
1178 if let Some(x) = args.name { builder.add_name(x); }
1179 if let Some(x) = args.pos { builder.add_pos(x); }
1180 builder.add_hp(args.hp);
1181 builder.add_mana(args.mana);
Austin Schuh272c6132020-11-14 16:37:52 -08001182 builder.add_signed_enum(args.signed_enum);
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001183 builder.add_any_ambiguous_type(args.any_ambiguous_type);
1184 builder.add_any_unique_type(args.any_unique_type);
1185 builder.add_testbool(args.testbool);
1186 builder.add_test_type(args.test_type);
1187 builder.add_color(args.color);
1188 builder.finish()
1189 }
1190
1191 pub const VT_POS: flatbuffers::VOffsetT = 4;
1192 pub const VT_MANA: flatbuffers::VOffsetT = 6;
1193 pub const VT_HP: flatbuffers::VOffsetT = 8;
1194 pub const VT_NAME: flatbuffers::VOffsetT = 10;
1195 pub const VT_INVENTORY: flatbuffers::VOffsetT = 14;
1196 pub const VT_COLOR: flatbuffers::VOffsetT = 16;
1197 pub const VT_TEST_TYPE: flatbuffers::VOffsetT = 18;
1198 pub const VT_TEST: flatbuffers::VOffsetT = 20;
1199 pub const VT_TEST4: flatbuffers::VOffsetT = 22;
1200 pub const VT_TESTARRAYOFSTRING: flatbuffers::VOffsetT = 24;
1201 pub const VT_TESTARRAYOFTABLES: flatbuffers::VOffsetT = 26;
1202 pub const VT_ENEMY: flatbuffers::VOffsetT = 28;
1203 pub const VT_TESTNESTEDFLATBUFFER: flatbuffers::VOffsetT = 30;
1204 pub const VT_TESTEMPTY: flatbuffers::VOffsetT = 32;
1205 pub const VT_TESTBOOL: flatbuffers::VOffsetT = 34;
1206 pub const VT_TESTHASHS32_FNV1: flatbuffers::VOffsetT = 36;
1207 pub const VT_TESTHASHU32_FNV1: flatbuffers::VOffsetT = 38;
1208 pub const VT_TESTHASHS64_FNV1: flatbuffers::VOffsetT = 40;
1209 pub const VT_TESTHASHU64_FNV1: flatbuffers::VOffsetT = 42;
1210 pub const VT_TESTHASHS32_FNV1A: flatbuffers::VOffsetT = 44;
1211 pub const VT_TESTHASHU32_FNV1A: flatbuffers::VOffsetT = 46;
1212 pub const VT_TESTHASHS64_FNV1A: flatbuffers::VOffsetT = 48;
1213 pub const VT_TESTHASHU64_FNV1A: flatbuffers::VOffsetT = 50;
1214 pub const VT_TESTARRAYOFBOOLS: flatbuffers::VOffsetT = 52;
1215 pub const VT_TESTF: flatbuffers::VOffsetT = 54;
1216 pub const VT_TESTF2: flatbuffers::VOffsetT = 56;
1217 pub const VT_TESTF3: flatbuffers::VOffsetT = 58;
1218 pub const VT_TESTARRAYOFSTRING2: flatbuffers::VOffsetT = 60;
1219 pub const VT_TESTARRAYOFSORTEDSTRUCT: flatbuffers::VOffsetT = 62;
1220 pub const VT_FLEX: flatbuffers::VOffsetT = 64;
1221 pub const VT_TEST5: flatbuffers::VOffsetT = 66;
1222 pub const VT_VECTOR_OF_LONGS: flatbuffers::VOffsetT = 68;
1223 pub const VT_VECTOR_OF_DOUBLES: flatbuffers::VOffsetT = 70;
1224 pub const VT_PARENT_NAMESPACE_TEST: flatbuffers::VOffsetT = 72;
1225 pub const VT_VECTOR_OF_REFERRABLES: flatbuffers::VOffsetT = 74;
1226 pub const VT_SINGLE_WEAK_REFERENCE: flatbuffers::VOffsetT = 76;
1227 pub const VT_VECTOR_OF_WEAK_REFERENCES: flatbuffers::VOffsetT = 78;
1228 pub const VT_VECTOR_OF_STRONG_REFERRABLES: flatbuffers::VOffsetT = 80;
1229 pub const VT_CO_OWNING_REFERENCE: flatbuffers::VOffsetT = 82;
1230 pub const VT_VECTOR_OF_CO_OWNING_REFERENCES: flatbuffers::VOffsetT = 84;
1231 pub const VT_NON_OWNING_REFERENCE: flatbuffers::VOffsetT = 86;
1232 pub const VT_VECTOR_OF_NON_OWNING_REFERENCES: flatbuffers::VOffsetT = 88;
1233 pub const VT_ANY_UNIQUE_TYPE: flatbuffers::VOffsetT = 90;
1234 pub const VT_ANY_UNIQUE: flatbuffers::VOffsetT = 92;
1235 pub const VT_ANY_AMBIGUOUS_TYPE: flatbuffers::VOffsetT = 94;
1236 pub const VT_ANY_AMBIGUOUS: flatbuffers::VOffsetT = 96;
1237 pub const VT_VECTOR_OF_ENUMS: flatbuffers::VOffsetT = 98;
Austin Schuh272c6132020-11-14 16:37:52 -08001238 pub const VT_SIGNED_ENUM: flatbuffers::VOffsetT = 100;
1239 pub const VT_TESTREQUIREDNESTEDFLATBUFFER: flatbuffers::VOffsetT = 102;
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001240
1241 #[inline]
1242 pub fn pos(&self) -> Option<&'a Vec3> {
1243 self._tab.get::<Vec3>(Monster::VT_POS, None)
1244 }
1245 #[inline]
1246 pub fn mana(&self) -> i16 {
1247 self._tab.get::<i16>(Monster::VT_MANA, Some(150)).unwrap()
1248 }
1249 #[inline]
1250 pub fn hp(&self) -> i16 {
1251 self._tab.get::<i16>(Monster::VT_HP, Some(100)).unwrap()
1252 }
1253 #[inline]
1254 pub fn name(&self) -> &'a str {
1255 self._tab.get::<flatbuffers::ForwardsUOffset<&str>>(Monster::VT_NAME, None).unwrap()
1256 }
1257 #[inline]
1258 pub fn key_compare_less_than(&self, o: &Monster) -> bool {
1259 self.name() < o.name()
1260 }
1261
1262 #[inline]
1263 pub fn key_compare_with_value(&self, val: & str) -> ::std::cmp::Ordering {
1264 let key = self.name();
1265 key.cmp(&val)
1266 }
1267 #[inline]
1268 pub fn inventory(&self) -> Option<&'a [u8]> {
1269 self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, u8>>>(Monster::VT_INVENTORY, None).map(|v| v.safe_slice())
1270 }
1271 #[inline]
1272 pub fn color(&self) -> Color {
1273 self._tab.get::<Color>(Monster::VT_COLOR, Some(Color::Blue)).unwrap()
1274 }
1275 #[inline]
1276 pub fn test_type(&self) -> Any {
1277 self._tab.get::<Any>(Monster::VT_TEST_TYPE, Some(Any::NONE)).unwrap()
1278 }
1279 #[inline]
1280 pub fn test(&self) -> Option<flatbuffers::Table<'a>> {
1281 self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Table<'a>>>(Monster::VT_TEST, None)
1282 }
1283 #[inline]
1284 pub fn test4(&self) -> Option<&'a [Test]> {
1285 self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<Test>>>(Monster::VT_TEST4, None).map(|v| v.safe_slice() )
1286 }
1287 #[inline]
1288 pub fn testarrayofstring(&self) -> Option<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<&'a str>>> {
1289 self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<flatbuffers::ForwardsUOffset<&'a str>>>>(Monster::VT_TESTARRAYOFSTRING, None)
1290 }
1291 /// an example documentation comment: this will end up in the generated code
1292 /// multiline too
1293 #[inline]
1294 pub fn testarrayoftables(&self) -> Option<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<Monster<'a>>>> {
1295 self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<flatbuffers::ForwardsUOffset<Monster<'a>>>>>(Monster::VT_TESTARRAYOFTABLES, None)
1296 }
1297 #[inline]
1298 pub fn enemy(&self) -> Option<Monster<'a>> {
1299 self._tab.get::<flatbuffers::ForwardsUOffset<Monster<'a>>>(Monster::VT_ENEMY, None)
1300 }
1301 #[inline]
1302 pub fn testnestedflatbuffer(&self) -> Option<&'a [u8]> {
1303 self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, u8>>>(Monster::VT_TESTNESTEDFLATBUFFER, None).map(|v| v.safe_slice())
1304 }
Austin Schuh272c6132020-11-14 16:37:52 -08001305 pub fn testnestedflatbuffer_nested_flatbuffer(&'a self) -> Option<Monster<'a>> {
1306 self.testnestedflatbuffer().map(|data| {
1307 use flatbuffers::Follow;
1308 <flatbuffers::ForwardsUOffset<Monster<'a>>>::follow(data, 0)
1309 })
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001310 }
1311 #[inline]
1312 pub fn testempty(&self) -> Option<Stat<'a>> {
1313 self._tab.get::<flatbuffers::ForwardsUOffset<Stat<'a>>>(Monster::VT_TESTEMPTY, None)
1314 }
1315 #[inline]
1316 pub fn testbool(&self) -> bool {
1317 self._tab.get::<bool>(Monster::VT_TESTBOOL, Some(false)).unwrap()
1318 }
1319 #[inline]
1320 pub fn testhashs32_fnv1(&self) -> i32 {
1321 self._tab.get::<i32>(Monster::VT_TESTHASHS32_FNV1, Some(0)).unwrap()
1322 }
1323 #[inline]
1324 pub fn testhashu32_fnv1(&self) -> u32 {
1325 self._tab.get::<u32>(Monster::VT_TESTHASHU32_FNV1, Some(0)).unwrap()
1326 }
1327 #[inline]
1328 pub fn testhashs64_fnv1(&self) -> i64 {
1329 self._tab.get::<i64>(Monster::VT_TESTHASHS64_FNV1, Some(0)).unwrap()
1330 }
1331 #[inline]
1332 pub fn testhashu64_fnv1(&self) -> u64 {
1333 self._tab.get::<u64>(Monster::VT_TESTHASHU64_FNV1, Some(0)).unwrap()
1334 }
1335 #[inline]
1336 pub fn testhashs32_fnv1a(&self) -> i32 {
1337 self._tab.get::<i32>(Monster::VT_TESTHASHS32_FNV1A, Some(0)).unwrap()
1338 }
1339 #[inline]
1340 pub fn testhashu32_fnv1a(&self) -> u32 {
1341 self._tab.get::<u32>(Monster::VT_TESTHASHU32_FNV1A, Some(0)).unwrap()
1342 }
1343 #[inline]
1344 pub fn testhashs64_fnv1a(&self) -> i64 {
1345 self._tab.get::<i64>(Monster::VT_TESTHASHS64_FNV1A, Some(0)).unwrap()
1346 }
1347 #[inline]
1348 pub fn testhashu64_fnv1a(&self) -> u64 {
1349 self._tab.get::<u64>(Monster::VT_TESTHASHU64_FNV1A, Some(0)).unwrap()
1350 }
1351 #[inline]
1352 pub fn testarrayofbools(&self) -> Option<&'a [bool]> {
1353 self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, bool>>>(Monster::VT_TESTARRAYOFBOOLS, None).map(|v| v.safe_slice())
1354 }
1355 #[inline]
1356 pub fn testf(&self) -> f32 {
1357 self._tab.get::<f32>(Monster::VT_TESTF, Some(3.14159)).unwrap()
1358 }
1359 #[inline]
1360 pub fn testf2(&self) -> f32 {
1361 self._tab.get::<f32>(Monster::VT_TESTF2, Some(3.0)).unwrap()
1362 }
1363 #[inline]
1364 pub fn testf3(&self) -> f32 {
1365 self._tab.get::<f32>(Monster::VT_TESTF3, Some(0.0)).unwrap()
1366 }
1367 #[inline]
1368 pub fn testarrayofstring2(&self) -> Option<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<&'a str>>> {
1369 self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<flatbuffers::ForwardsUOffset<&'a str>>>>(Monster::VT_TESTARRAYOFSTRING2, None)
1370 }
1371 #[inline]
1372 pub fn testarrayofsortedstruct(&self) -> Option<&'a [Ability]> {
1373 self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<Ability>>>(Monster::VT_TESTARRAYOFSORTEDSTRUCT, None).map(|v| v.safe_slice() )
1374 }
1375 #[inline]
1376 pub fn flex(&self) -> Option<&'a [u8]> {
1377 self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, u8>>>(Monster::VT_FLEX, None).map(|v| v.safe_slice())
1378 }
1379 #[inline]
1380 pub fn test5(&self) -> Option<&'a [Test]> {
1381 self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<Test>>>(Monster::VT_TEST5, None).map(|v| v.safe_slice() )
1382 }
1383 #[inline]
1384 pub fn vector_of_longs(&self) -> Option<flatbuffers::Vector<'a, i64>> {
1385 self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, i64>>>(Monster::VT_VECTOR_OF_LONGS, None)
1386 }
1387 #[inline]
1388 pub fn vector_of_doubles(&self) -> Option<flatbuffers::Vector<'a, f64>> {
1389 self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, f64>>>(Monster::VT_VECTOR_OF_DOUBLES, None)
1390 }
1391 #[inline]
1392 pub fn parent_namespace_test(&self) -> Option<super::InParentNamespace<'a>> {
1393 self._tab.get::<flatbuffers::ForwardsUOffset<super::InParentNamespace<'a>>>(Monster::VT_PARENT_NAMESPACE_TEST, None)
1394 }
1395 #[inline]
1396 pub fn vector_of_referrables(&self) -> Option<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<Referrable<'a>>>> {
1397 self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<flatbuffers::ForwardsUOffset<Referrable<'a>>>>>(Monster::VT_VECTOR_OF_REFERRABLES, None)
1398 }
1399 #[inline]
1400 pub fn single_weak_reference(&self) -> u64 {
1401 self._tab.get::<u64>(Monster::VT_SINGLE_WEAK_REFERENCE, Some(0)).unwrap()
1402 }
1403 #[inline]
1404 pub fn vector_of_weak_references(&self) -> Option<flatbuffers::Vector<'a, u64>> {
1405 self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, u64>>>(Monster::VT_VECTOR_OF_WEAK_REFERENCES, None)
1406 }
1407 #[inline]
1408 pub fn vector_of_strong_referrables(&self) -> Option<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<Referrable<'a>>>> {
1409 self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<flatbuffers::ForwardsUOffset<Referrable<'a>>>>>(Monster::VT_VECTOR_OF_STRONG_REFERRABLES, None)
1410 }
1411 #[inline]
1412 pub fn co_owning_reference(&self) -> u64 {
1413 self._tab.get::<u64>(Monster::VT_CO_OWNING_REFERENCE, Some(0)).unwrap()
1414 }
1415 #[inline]
1416 pub fn vector_of_co_owning_references(&self) -> Option<flatbuffers::Vector<'a, u64>> {
1417 self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, u64>>>(Monster::VT_VECTOR_OF_CO_OWNING_REFERENCES, None)
1418 }
1419 #[inline]
1420 pub fn non_owning_reference(&self) -> u64 {
1421 self._tab.get::<u64>(Monster::VT_NON_OWNING_REFERENCE, Some(0)).unwrap()
1422 }
1423 #[inline]
1424 pub fn vector_of_non_owning_references(&self) -> Option<flatbuffers::Vector<'a, u64>> {
1425 self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, u64>>>(Monster::VT_VECTOR_OF_NON_OWNING_REFERENCES, None)
1426 }
1427 #[inline]
1428 pub fn any_unique_type(&self) -> AnyUniqueAliases {
1429 self._tab.get::<AnyUniqueAliases>(Monster::VT_ANY_UNIQUE_TYPE, Some(AnyUniqueAliases::NONE)).unwrap()
1430 }
1431 #[inline]
1432 pub fn any_unique(&self) -> Option<flatbuffers::Table<'a>> {
1433 self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Table<'a>>>(Monster::VT_ANY_UNIQUE, None)
1434 }
1435 #[inline]
1436 pub fn any_ambiguous_type(&self) -> AnyAmbiguousAliases {
1437 self._tab.get::<AnyAmbiguousAliases>(Monster::VT_ANY_AMBIGUOUS_TYPE, Some(AnyAmbiguousAliases::NONE)).unwrap()
1438 }
1439 #[inline]
1440 pub fn any_ambiguous(&self) -> Option<flatbuffers::Table<'a>> {
1441 self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Table<'a>>>(Monster::VT_ANY_AMBIGUOUS, None)
1442 }
1443 #[inline]
1444 pub fn vector_of_enums(&self) -> Option<flatbuffers::Vector<'a, Color>> {
1445 self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, Color>>>(Monster::VT_VECTOR_OF_ENUMS, None)
1446 }
1447 #[inline]
Austin Schuh272c6132020-11-14 16:37:52 -08001448 pub fn signed_enum(&self) -> Race {
1449 self._tab.get::<Race>(Monster::VT_SIGNED_ENUM, Some(Race::None)).unwrap()
1450 }
1451 #[inline]
1452 pub fn testrequirednestedflatbuffer(&self) -> Option<&'a [u8]> {
1453 self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, u8>>>(Monster::VT_TESTREQUIREDNESTEDFLATBUFFER, None).map(|v| v.safe_slice())
1454 }
1455 pub fn testrequirednestedflatbuffer_nested_flatbuffer(&'a self) -> Option<Monster<'a>> {
1456 self.testrequirednestedflatbuffer().map(|data| {
1457 use flatbuffers::Follow;
1458 <flatbuffers::ForwardsUOffset<Monster<'a>>>::follow(data, 0)
1459 })
1460 }
1461 #[inline]
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001462 #[allow(non_snake_case)]
1463 pub fn test_as_monster(&self) -> Option<Monster<'a>> {
1464 if self.test_type() == Any::Monster {
Austin Schuh272c6132020-11-14 16:37:52 -08001465 self.test().map(Monster::init_from_table)
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001466 } else {
1467 None
1468 }
1469 }
1470
1471 #[inline]
1472 #[allow(non_snake_case)]
1473 pub fn test_as_test_simple_table_with_enum(&self) -> Option<TestSimpleTableWithEnum<'a>> {
1474 if self.test_type() == Any::TestSimpleTableWithEnum {
Austin Schuh272c6132020-11-14 16:37:52 -08001475 self.test().map(TestSimpleTableWithEnum::init_from_table)
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001476 } else {
1477 None
1478 }
1479 }
1480
1481 #[inline]
1482 #[allow(non_snake_case)]
1483 pub fn test_as_my_game_example_2_monster(&self) -> Option<super::example_2::Monster<'a>> {
1484 if self.test_type() == Any::MyGame_Example2_Monster {
Austin Schuh272c6132020-11-14 16:37:52 -08001485 self.test().map(super::example_2::Monster::init_from_table)
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001486 } else {
1487 None
1488 }
1489 }
1490
1491 #[inline]
1492 #[allow(non_snake_case)]
1493 pub fn any_unique_as_m(&self) -> Option<Monster<'a>> {
1494 if self.any_unique_type() == AnyUniqueAliases::M {
Austin Schuh272c6132020-11-14 16:37:52 -08001495 self.any_unique().map(Monster::init_from_table)
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001496 } else {
1497 None
1498 }
1499 }
1500
1501 #[inline]
1502 #[allow(non_snake_case)]
1503 pub fn any_unique_as_ts(&self) -> Option<TestSimpleTableWithEnum<'a>> {
1504 if self.any_unique_type() == AnyUniqueAliases::TS {
Austin Schuh272c6132020-11-14 16:37:52 -08001505 self.any_unique().map(TestSimpleTableWithEnum::init_from_table)
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001506 } else {
1507 None
1508 }
1509 }
1510
1511 #[inline]
1512 #[allow(non_snake_case)]
1513 pub fn any_unique_as_m2(&self) -> Option<super::example_2::Monster<'a>> {
1514 if self.any_unique_type() == AnyUniqueAliases::M2 {
Austin Schuh272c6132020-11-14 16:37:52 -08001515 self.any_unique().map(super::example_2::Monster::init_from_table)
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001516 } else {
1517 None
1518 }
1519 }
1520
1521 #[inline]
1522 #[allow(non_snake_case)]
1523 pub fn any_ambiguous_as_m1(&self) -> Option<Monster<'a>> {
1524 if self.any_ambiguous_type() == AnyAmbiguousAliases::M1 {
Austin Schuh272c6132020-11-14 16:37:52 -08001525 self.any_ambiguous().map(Monster::init_from_table)
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001526 } else {
1527 None
1528 }
1529 }
1530
1531 #[inline]
1532 #[allow(non_snake_case)]
1533 pub fn any_ambiguous_as_m2(&self) -> Option<Monster<'a>> {
1534 if self.any_ambiguous_type() == AnyAmbiguousAliases::M2 {
Austin Schuh272c6132020-11-14 16:37:52 -08001535 self.any_ambiguous().map(Monster::init_from_table)
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001536 } else {
1537 None
1538 }
1539 }
1540
1541 #[inline]
1542 #[allow(non_snake_case)]
1543 pub fn any_ambiguous_as_m3(&self) -> Option<Monster<'a>> {
1544 if self.any_ambiguous_type() == AnyAmbiguousAliases::M3 {
Austin Schuh272c6132020-11-14 16:37:52 -08001545 self.any_ambiguous().map(Monster::init_from_table)
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001546 } else {
1547 None
1548 }
1549 }
1550
1551}
1552
1553pub struct MonsterArgs<'a> {
Austin Schuh272c6132020-11-14 16:37:52 -08001554 pub pos: Option<&'a Vec3>,
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001555 pub mana: i16,
1556 pub hp: i16,
Austin Schuh272c6132020-11-14 16:37:52 -08001557 pub name: Option<flatbuffers::WIPOffset<&'a str>>,
1558 pub inventory: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, u8>>>,
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001559 pub color: Color,
1560 pub test_type: Any,
1561 pub test: Option<flatbuffers::WIPOffset<flatbuffers::UnionWIPOffset>>,
Austin Schuh272c6132020-11-14 16:37:52 -08001562 pub test4: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, Test>>>,
1563 pub testarrayofstring: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<&'a str>>>>,
1564 pub testarrayoftables: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<Monster<'a>>>>>,
1565 pub enemy: Option<flatbuffers::WIPOffset<Monster<'a>>>,
1566 pub testnestedflatbuffer: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, u8>>>,
1567 pub testempty: Option<flatbuffers::WIPOffset<Stat<'a>>>,
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001568 pub testbool: bool,
1569 pub testhashs32_fnv1: i32,
1570 pub testhashu32_fnv1: u32,
1571 pub testhashs64_fnv1: i64,
1572 pub testhashu64_fnv1: u64,
1573 pub testhashs32_fnv1a: i32,
1574 pub testhashu32_fnv1a: u32,
1575 pub testhashs64_fnv1a: i64,
1576 pub testhashu64_fnv1a: u64,
Austin Schuh272c6132020-11-14 16:37:52 -08001577 pub testarrayofbools: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, bool>>>,
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001578 pub testf: f32,
1579 pub testf2: f32,
1580 pub testf3: f32,
Austin Schuh272c6132020-11-14 16:37:52 -08001581 pub testarrayofstring2: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<&'a str>>>>,
1582 pub testarrayofsortedstruct: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, Ability>>>,
1583 pub flex: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, u8>>>,
1584 pub test5: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, Test>>>,
1585 pub vector_of_longs: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, i64>>>,
1586 pub vector_of_doubles: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, f64>>>,
1587 pub parent_namespace_test: Option<flatbuffers::WIPOffset<super::InParentNamespace<'a>>>,
1588 pub vector_of_referrables: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<Referrable<'a>>>>>,
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001589 pub single_weak_reference: u64,
Austin Schuh272c6132020-11-14 16:37:52 -08001590 pub vector_of_weak_references: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, u64>>>,
1591 pub vector_of_strong_referrables: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<Referrable<'a>>>>>,
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001592 pub co_owning_reference: u64,
Austin Schuh272c6132020-11-14 16:37:52 -08001593 pub vector_of_co_owning_references: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, u64>>>,
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001594 pub non_owning_reference: u64,
Austin Schuh272c6132020-11-14 16:37:52 -08001595 pub vector_of_non_owning_references: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, u64>>>,
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001596 pub any_unique_type: AnyUniqueAliases,
1597 pub any_unique: Option<flatbuffers::WIPOffset<flatbuffers::UnionWIPOffset>>,
1598 pub any_ambiguous_type: AnyAmbiguousAliases,
1599 pub any_ambiguous: Option<flatbuffers::WIPOffset<flatbuffers::UnionWIPOffset>>,
Austin Schuh272c6132020-11-14 16:37:52 -08001600 pub vector_of_enums: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, Color>>>,
1601 pub signed_enum: Race,
1602 pub testrequirednestedflatbuffer: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, u8>>>,
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001603}
1604impl<'a> Default for MonsterArgs<'a> {
1605 #[inline]
1606 fn default() -> Self {
1607 MonsterArgs {
1608 pos: None,
1609 mana: 150,
1610 hp: 100,
1611 name: None, // required field
1612 inventory: None,
1613 color: Color::Blue,
1614 test_type: Any::NONE,
1615 test: None,
1616 test4: None,
1617 testarrayofstring: None,
1618 testarrayoftables: None,
1619 enemy: None,
1620 testnestedflatbuffer: None,
1621 testempty: None,
1622 testbool: false,
1623 testhashs32_fnv1: 0,
1624 testhashu32_fnv1: 0,
1625 testhashs64_fnv1: 0,
1626 testhashu64_fnv1: 0,
1627 testhashs32_fnv1a: 0,
1628 testhashu32_fnv1a: 0,
1629 testhashs64_fnv1a: 0,
1630 testhashu64_fnv1a: 0,
1631 testarrayofbools: None,
1632 testf: 3.14159,
1633 testf2: 3.0,
1634 testf3: 0.0,
1635 testarrayofstring2: None,
1636 testarrayofsortedstruct: None,
1637 flex: None,
1638 test5: None,
1639 vector_of_longs: None,
1640 vector_of_doubles: None,
1641 parent_namespace_test: None,
1642 vector_of_referrables: None,
1643 single_weak_reference: 0,
1644 vector_of_weak_references: None,
1645 vector_of_strong_referrables: None,
1646 co_owning_reference: 0,
1647 vector_of_co_owning_references: None,
1648 non_owning_reference: 0,
1649 vector_of_non_owning_references: None,
1650 any_unique_type: AnyUniqueAliases::NONE,
1651 any_unique: None,
1652 any_ambiguous_type: AnyAmbiguousAliases::NONE,
1653 any_ambiguous: None,
1654 vector_of_enums: None,
Austin Schuh272c6132020-11-14 16:37:52 -08001655 signed_enum: Race::None,
1656 testrequirednestedflatbuffer: None,
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001657 }
1658 }
1659}
1660pub struct MonsterBuilder<'a: 'b, 'b> {
1661 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a>,
1662 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
1663}
1664impl<'a: 'b, 'b> MonsterBuilder<'a, 'b> {
1665 #[inline]
Austin Schuh272c6132020-11-14 16:37:52 -08001666 pub fn add_pos(&mut self, pos: &Vec3) {
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001667 self.fbb_.push_slot_always::<&Vec3>(Monster::VT_POS, pos);
1668 }
1669 #[inline]
1670 pub fn add_mana(&mut self, mana: i16) {
1671 self.fbb_.push_slot::<i16>(Monster::VT_MANA, mana, 150);
1672 }
1673 #[inline]
1674 pub fn add_hp(&mut self, hp: i16) {
1675 self.fbb_.push_slot::<i16>(Monster::VT_HP, hp, 100);
1676 }
1677 #[inline]
1678 pub fn add_name(&mut self, name: flatbuffers::WIPOffset<&'b str>) {
1679 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Monster::VT_NAME, name);
1680 }
1681 #[inline]
1682 pub fn add_inventory(&mut self, inventory: flatbuffers::WIPOffset<flatbuffers::Vector<'b , u8>>) {
1683 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Monster::VT_INVENTORY, inventory);
1684 }
1685 #[inline]
1686 pub fn add_color(&mut self, color: Color) {
1687 self.fbb_.push_slot::<Color>(Monster::VT_COLOR, color, Color::Blue);
1688 }
1689 #[inline]
1690 pub fn add_test_type(&mut self, test_type: Any) {
1691 self.fbb_.push_slot::<Any>(Monster::VT_TEST_TYPE, test_type, Any::NONE);
1692 }
1693 #[inline]
1694 pub fn add_test(&mut self, test: flatbuffers::WIPOffset<flatbuffers::UnionWIPOffset>) {
1695 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Monster::VT_TEST, test);
1696 }
1697 #[inline]
1698 pub fn add_test4(&mut self, test4: flatbuffers::WIPOffset<flatbuffers::Vector<'b , Test>>) {
1699 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Monster::VT_TEST4, test4);
1700 }
1701 #[inline]
1702 pub fn add_testarrayofstring(&mut self, testarrayofstring: flatbuffers::WIPOffset<flatbuffers::Vector<'b , flatbuffers::ForwardsUOffset<&'b str>>>) {
1703 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Monster::VT_TESTARRAYOFSTRING, testarrayofstring);
1704 }
1705 #[inline]
1706 pub fn add_testarrayoftables(&mut self, testarrayoftables: flatbuffers::WIPOffset<flatbuffers::Vector<'b , flatbuffers::ForwardsUOffset<Monster<'b >>>>) {
1707 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Monster::VT_TESTARRAYOFTABLES, testarrayoftables);
1708 }
1709 #[inline]
1710 pub fn add_enemy(&mut self, enemy: flatbuffers::WIPOffset<Monster<'b >>) {
1711 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<Monster>>(Monster::VT_ENEMY, enemy);
1712 }
1713 #[inline]
1714 pub fn add_testnestedflatbuffer(&mut self, testnestedflatbuffer: flatbuffers::WIPOffset<flatbuffers::Vector<'b , u8>>) {
1715 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Monster::VT_TESTNESTEDFLATBUFFER, testnestedflatbuffer);
1716 }
1717 #[inline]
1718 pub fn add_testempty(&mut self, testempty: flatbuffers::WIPOffset<Stat<'b >>) {
1719 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<Stat>>(Monster::VT_TESTEMPTY, testempty);
1720 }
1721 #[inline]
1722 pub fn add_testbool(&mut self, testbool: bool) {
1723 self.fbb_.push_slot::<bool>(Monster::VT_TESTBOOL, testbool, false);
1724 }
1725 #[inline]
1726 pub fn add_testhashs32_fnv1(&mut self, testhashs32_fnv1: i32) {
1727 self.fbb_.push_slot::<i32>(Monster::VT_TESTHASHS32_FNV1, testhashs32_fnv1, 0);
1728 }
1729 #[inline]
1730 pub fn add_testhashu32_fnv1(&mut self, testhashu32_fnv1: u32) {
1731 self.fbb_.push_slot::<u32>(Monster::VT_TESTHASHU32_FNV1, testhashu32_fnv1, 0);
1732 }
1733 #[inline]
1734 pub fn add_testhashs64_fnv1(&mut self, testhashs64_fnv1: i64) {
1735 self.fbb_.push_slot::<i64>(Monster::VT_TESTHASHS64_FNV1, testhashs64_fnv1, 0);
1736 }
1737 #[inline]
1738 pub fn add_testhashu64_fnv1(&mut self, testhashu64_fnv1: u64) {
1739 self.fbb_.push_slot::<u64>(Monster::VT_TESTHASHU64_FNV1, testhashu64_fnv1, 0);
1740 }
1741 #[inline]
1742 pub fn add_testhashs32_fnv1a(&mut self, testhashs32_fnv1a: i32) {
1743 self.fbb_.push_slot::<i32>(Monster::VT_TESTHASHS32_FNV1A, testhashs32_fnv1a, 0);
1744 }
1745 #[inline]
1746 pub fn add_testhashu32_fnv1a(&mut self, testhashu32_fnv1a: u32) {
1747 self.fbb_.push_slot::<u32>(Monster::VT_TESTHASHU32_FNV1A, testhashu32_fnv1a, 0);
1748 }
1749 #[inline]
1750 pub fn add_testhashs64_fnv1a(&mut self, testhashs64_fnv1a: i64) {
1751 self.fbb_.push_slot::<i64>(Monster::VT_TESTHASHS64_FNV1A, testhashs64_fnv1a, 0);
1752 }
1753 #[inline]
1754 pub fn add_testhashu64_fnv1a(&mut self, testhashu64_fnv1a: u64) {
1755 self.fbb_.push_slot::<u64>(Monster::VT_TESTHASHU64_FNV1A, testhashu64_fnv1a, 0);
1756 }
1757 #[inline]
1758 pub fn add_testarrayofbools(&mut self, testarrayofbools: flatbuffers::WIPOffset<flatbuffers::Vector<'b , bool>>) {
1759 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Monster::VT_TESTARRAYOFBOOLS, testarrayofbools);
1760 }
1761 #[inline]
1762 pub fn add_testf(&mut self, testf: f32) {
1763 self.fbb_.push_slot::<f32>(Monster::VT_TESTF, testf, 3.14159);
1764 }
1765 #[inline]
1766 pub fn add_testf2(&mut self, testf2: f32) {
1767 self.fbb_.push_slot::<f32>(Monster::VT_TESTF2, testf2, 3.0);
1768 }
1769 #[inline]
1770 pub fn add_testf3(&mut self, testf3: f32) {
1771 self.fbb_.push_slot::<f32>(Monster::VT_TESTF3, testf3, 0.0);
1772 }
1773 #[inline]
1774 pub fn add_testarrayofstring2(&mut self, testarrayofstring2: flatbuffers::WIPOffset<flatbuffers::Vector<'b , flatbuffers::ForwardsUOffset<&'b str>>>) {
1775 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Monster::VT_TESTARRAYOFSTRING2, testarrayofstring2);
1776 }
1777 #[inline]
1778 pub fn add_testarrayofsortedstruct(&mut self, testarrayofsortedstruct: flatbuffers::WIPOffset<flatbuffers::Vector<'b , Ability>>) {
1779 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Monster::VT_TESTARRAYOFSORTEDSTRUCT, testarrayofsortedstruct);
1780 }
1781 #[inline]
1782 pub fn add_flex(&mut self, flex: flatbuffers::WIPOffset<flatbuffers::Vector<'b , u8>>) {
1783 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Monster::VT_FLEX, flex);
1784 }
1785 #[inline]
1786 pub fn add_test5(&mut self, test5: flatbuffers::WIPOffset<flatbuffers::Vector<'b , Test>>) {
1787 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Monster::VT_TEST5, test5);
1788 }
1789 #[inline]
1790 pub fn add_vector_of_longs(&mut self, vector_of_longs: flatbuffers::WIPOffset<flatbuffers::Vector<'b , i64>>) {
1791 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Monster::VT_VECTOR_OF_LONGS, vector_of_longs);
1792 }
1793 #[inline]
1794 pub fn add_vector_of_doubles(&mut self, vector_of_doubles: flatbuffers::WIPOffset<flatbuffers::Vector<'b , f64>>) {
1795 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Monster::VT_VECTOR_OF_DOUBLES, vector_of_doubles);
1796 }
1797 #[inline]
1798 pub fn add_parent_namespace_test(&mut self, parent_namespace_test: flatbuffers::WIPOffset<super::InParentNamespace<'b >>) {
1799 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<super::InParentNamespace>>(Monster::VT_PARENT_NAMESPACE_TEST, parent_namespace_test);
1800 }
1801 #[inline]
1802 pub fn add_vector_of_referrables(&mut self, vector_of_referrables: flatbuffers::WIPOffset<flatbuffers::Vector<'b , flatbuffers::ForwardsUOffset<Referrable<'b >>>>) {
1803 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Monster::VT_VECTOR_OF_REFERRABLES, vector_of_referrables);
1804 }
1805 #[inline]
1806 pub fn add_single_weak_reference(&mut self, single_weak_reference: u64) {
1807 self.fbb_.push_slot::<u64>(Monster::VT_SINGLE_WEAK_REFERENCE, single_weak_reference, 0);
1808 }
1809 #[inline]
1810 pub fn add_vector_of_weak_references(&mut self, vector_of_weak_references: flatbuffers::WIPOffset<flatbuffers::Vector<'b , u64>>) {
1811 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Monster::VT_VECTOR_OF_WEAK_REFERENCES, vector_of_weak_references);
1812 }
1813 #[inline]
1814 pub fn add_vector_of_strong_referrables(&mut self, vector_of_strong_referrables: flatbuffers::WIPOffset<flatbuffers::Vector<'b , flatbuffers::ForwardsUOffset<Referrable<'b >>>>) {
1815 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Monster::VT_VECTOR_OF_STRONG_REFERRABLES, vector_of_strong_referrables);
1816 }
1817 #[inline]
1818 pub fn add_co_owning_reference(&mut self, co_owning_reference: u64) {
1819 self.fbb_.push_slot::<u64>(Monster::VT_CO_OWNING_REFERENCE, co_owning_reference, 0);
1820 }
1821 #[inline]
1822 pub fn add_vector_of_co_owning_references(&mut self, vector_of_co_owning_references: flatbuffers::WIPOffset<flatbuffers::Vector<'b , u64>>) {
1823 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Monster::VT_VECTOR_OF_CO_OWNING_REFERENCES, vector_of_co_owning_references);
1824 }
1825 #[inline]
1826 pub fn add_non_owning_reference(&mut self, non_owning_reference: u64) {
1827 self.fbb_.push_slot::<u64>(Monster::VT_NON_OWNING_REFERENCE, non_owning_reference, 0);
1828 }
1829 #[inline]
1830 pub fn add_vector_of_non_owning_references(&mut self, vector_of_non_owning_references: flatbuffers::WIPOffset<flatbuffers::Vector<'b , u64>>) {
1831 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Monster::VT_VECTOR_OF_NON_OWNING_REFERENCES, vector_of_non_owning_references);
1832 }
1833 #[inline]
1834 pub fn add_any_unique_type(&mut self, any_unique_type: AnyUniqueAliases) {
1835 self.fbb_.push_slot::<AnyUniqueAliases>(Monster::VT_ANY_UNIQUE_TYPE, any_unique_type, AnyUniqueAliases::NONE);
1836 }
1837 #[inline]
1838 pub fn add_any_unique(&mut self, any_unique: flatbuffers::WIPOffset<flatbuffers::UnionWIPOffset>) {
1839 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Monster::VT_ANY_UNIQUE, any_unique);
1840 }
1841 #[inline]
1842 pub fn add_any_ambiguous_type(&mut self, any_ambiguous_type: AnyAmbiguousAliases) {
1843 self.fbb_.push_slot::<AnyAmbiguousAliases>(Monster::VT_ANY_AMBIGUOUS_TYPE, any_ambiguous_type, AnyAmbiguousAliases::NONE);
1844 }
1845 #[inline]
1846 pub fn add_any_ambiguous(&mut self, any_ambiguous: flatbuffers::WIPOffset<flatbuffers::UnionWIPOffset>) {
1847 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Monster::VT_ANY_AMBIGUOUS, any_ambiguous);
1848 }
1849 #[inline]
1850 pub fn add_vector_of_enums(&mut self, vector_of_enums: flatbuffers::WIPOffset<flatbuffers::Vector<'b , Color>>) {
1851 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Monster::VT_VECTOR_OF_ENUMS, vector_of_enums);
1852 }
1853 #[inline]
Austin Schuh272c6132020-11-14 16:37:52 -08001854 pub fn add_signed_enum(&mut self, signed_enum: Race) {
1855 self.fbb_.push_slot::<Race>(Monster::VT_SIGNED_ENUM, signed_enum, Race::None);
1856 }
1857 #[inline]
1858 pub fn add_testrequirednestedflatbuffer(&mut self, testrequirednestedflatbuffer: flatbuffers::WIPOffset<flatbuffers::Vector<'b , u8>>) {
1859 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Monster::VT_TESTREQUIREDNESTEDFLATBUFFER, testrequirednestedflatbuffer);
1860 }
1861 #[inline]
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001862 pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> MonsterBuilder<'a, 'b> {
1863 let start = _fbb.start_table();
1864 MonsterBuilder {
1865 fbb_: _fbb,
1866 start_: start,
1867 }
1868 }
1869 #[inline]
1870 pub fn finish(self) -> flatbuffers::WIPOffset<Monster<'a>> {
1871 let o = self.fbb_.end_table(self.start_);
1872 self.fbb_.required(o, Monster::VT_NAME,"name");
1873 flatbuffers::WIPOffset::new(o.value())
1874 }
1875}
1876
Austin Schuh272c6132020-11-14 16:37:52 -08001877impl std::fmt::Debug for Monster<'_> {
1878 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1879 let mut ds = f.debug_struct("Monster");
1880 ds.field("pos", &self.pos());
1881 ds.field("mana", &self.mana());
1882 ds.field("hp", &self.hp());
1883 ds.field("name", &self.name());
1884 ds.field("inventory", &self.inventory());
1885 ds.field("color", &self.color());
1886 ds.field("test_type", &self.test_type());
1887 match self.test_type() {
1888 Any::Monster => {
1889 if let Some(x) = self.test_as_monster() {
1890 ds.field("test", &x)
1891 } else {
1892 ds.field("test", &"InvalidFlatbuffer: Union discriminant does not match value.")
1893 }
1894 },
1895 Any::TestSimpleTableWithEnum => {
1896 if let Some(x) = self.test_as_test_simple_table_with_enum() {
1897 ds.field("test", &x)
1898 } else {
1899 ds.field("test", &"InvalidFlatbuffer: Union discriminant does not match value.")
1900 }
1901 },
1902 Any::MyGame_Example2_Monster => {
1903 if let Some(x) = self.test_as_my_game_example_2_monster() {
1904 ds.field("test", &x)
1905 } else {
1906 ds.field("test", &"InvalidFlatbuffer: Union discriminant does not match value.")
1907 }
1908 },
1909 _ => {
1910 let x: Option<()> = None;
1911 ds.field("test", &x)
1912 },
1913 };
1914 ds.field("test4", &self.test4());
1915 ds.field("testarrayofstring", &self.testarrayofstring());
1916 ds.field("testarrayoftables", &self.testarrayoftables());
1917 ds.field("enemy", &self.enemy());
1918 ds.field("testnestedflatbuffer", &self.testnestedflatbuffer());
1919 ds.field("testempty", &self.testempty());
1920 ds.field("testbool", &self.testbool());
1921 ds.field("testhashs32_fnv1", &self.testhashs32_fnv1());
1922 ds.field("testhashu32_fnv1", &self.testhashu32_fnv1());
1923 ds.field("testhashs64_fnv1", &self.testhashs64_fnv1());
1924 ds.field("testhashu64_fnv1", &self.testhashu64_fnv1());
1925 ds.field("testhashs32_fnv1a", &self.testhashs32_fnv1a());
1926 ds.field("testhashu32_fnv1a", &self.testhashu32_fnv1a());
1927 ds.field("testhashs64_fnv1a", &self.testhashs64_fnv1a());
1928 ds.field("testhashu64_fnv1a", &self.testhashu64_fnv1a());
1929 ds.field("testarrayofbools", &self.testarrayofbools());
1930 ds.field("testf", &self.testf());
1931 ds.field("testf2", &self.testf2());
1932 ds.field("testf3", &self.testf3());
1933 ds.field("testarrayofstring2", &self.testarrayofstring2());
1934 ds.field("testarrayofsortedstruct", &self.testarrayofsortedstruct());
1935 ds.field("flex", &self.flex());
1936 ds.field("test5", &self.test5());
1937 ds.field("vector_of_longs", &self.vector_of_longs());
1938 ds.field("vector_of_doubles", &self.vector_of_doubles());
1939 ds.field("parent_namespace_test", &self.parent_namespace_test());
1940 ds.field("vector_of_referrables", &self.vector_of_referrables());
1941 ds.field("single_weak_reference", &self.single_weak_reference());
1942 ds.field("vector_of_weak_references", &self.vector_of_weak_references());
1943 ds.field("vector_of_strong_referrables", &self.vector_of_strong_referrables());
1944 ds.field("co_owning_reference", &self.co_owning_reference());
1945 ds.field("vector_of_co_owning_references", &self.vector_of_co_owning_references());
1946 ds.field("non_owning_reference", &self.non_owning_reference());
1947 ds.field("vector_of_non_owning_references", &self.vector_of_non_owning_references());
1948 ds.field("any_unique_type", &self.any_unique_type());
1949 match self.any_unique_type() {
1950 AnyUniqueAliases::M => {
1951 if let Some(x) = self.any_unique_as_m() {
1952 ds.field("any_unique", &x)
1953 } else {
1954 ds.field("any_unique", &"InvalidFlatbuffer: Union discriminant does not match value.")
1955 }
1956 },
1957 AnyUniqueAliases::TS => {
1958 if let Some(x) = self.any_unique_as_ts() {
1959 ds.field("any_unique", &x)
1960 } else {
1961 ds.field("any_unique", &"InvalidFlatbuffer: Union discriminant does not match value.")
1962 }
1963 },
1964 AnyUniqueAliases::M2 => {
1965 if let Some(x) = self.any_unique_as_m2() {
1966 ds.field("any_unique", &x)
1967 } else {
1968 ds.field("any_unique", &"InvalidFlatbuffer: Union discriminant does not match value.")
1969 }
1970 },
1971 _ => {
1972 let x: Option<()> = None;
1973 ds.field("any_unique", &x)
1974 },
1975 };
1976 ds.field("any_ambiguous_type", &self.any_ambiguous_type());
1977 match self.any_ambiguous_type() {
1978 AnyAmbiguousAliases::M1 => {
1979 if let Some(x) = self.any_ambiguous_as_m1() {
1980 ds.field("any_ambiguous", &x)
1981 } else {
1982 ds.field("any_ambiguous", &"InvalidFlatbuffer: Union discriminant does not match value.")
1983 }
1984 },
1985 AnyAmbiguousAliases::M2 => {
1986 if let Some(x) = self.any_ambiguous_as_m2() {
1987 ds.field("any_ambiguous", &x)
1988 } else {
1989 ds.field("any_ambiguous", &"InvalidFlatbuffer: Union discriminant does not match value.")
1990 }
1991 },
1992 AnyAmbiguousAliases::M3 => {
1993 if let Some(x) = self.any_ambiguous_as_m3() {
1994 ds.field("any_ambiguous", &x)
1995 } else {
1996 ds.field("any_ambiguous", &"InvalidFlatbuffer: Union discriminant does not match value.")
1997 }
1998 },
1999 _ => {
2000 let x: Option<()> = None;
2001 ds.field("any_ambiguous", &x)
2002 },
2003 };
2004 ds.field("vector_of_enums", &self.vector_of_enums());
2005 ds.field("signed_enum", &self.signed_enum());
2006 ds.field("testrequirednestedflatbuffer", &self.testrequirednestedflatbuffer());
2007 ds.finish()
2008 }
2009}
Austin Schuhe89fa2d2019-08-14 20:24:23 -07002010pub enum TypeAliasesOffset {}
Austin Schuh272c6132020-11-14 16:37:52 -08002011#[derive(Copy, Clone, PartialEq)]
Austin Schuhe89fa2d2019-08-14 20:24:23 -07002012
2013pub struct TypeAliases<'a> {
2014 pub _tab: flatbuffers::Table<'a>,
2015}
2016
2017impl<'a> flatbuffers::Follow<'a> for TypeAliases<'a> {
2018 type Inner = TypeAliases<'a>;
2019 #[inline]
2020 fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
Austin Schuh272c6132020-11-14 16:37:52 -08002021 Self { _tab: flatbuffers::Table { buf, loc } }
Austin Schuhe89fa2d2019-08-14 20:24:23 -07002022 }
2023}
2024
2025impl<'a> TypeAliases<'a> {
Austin Schuh272c6132020-11-14 16:37:52 -08002026 pub const fn get_fully_qualified_name() -> &'static str {
2027 "MyGame.Example.TypeAliases"
2028 }
2029
Austin Schuhe89fa2d2019-08-14 20:24:23 -07002030 #[inline]
2031 pub fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
2032 TypeAliases {
2033 _tab: table,
2034 }
2035 }
2036 #[allow(unused_mut)]
2037 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>(
2038 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>,
2039 args: &'args TypeAliasesArgs<'args>) -> flatbuffers::WIPOffset<TypeAliases<'bldr>> {
2040 let mut builder = TypeAliasesBuilder::new(_fbb);
2041 builder.add_f64_(args.f64_);
2042 builder.add_u64_(args.u64_);
2043 builder.add_i64_(args.i64_);
2044 if let Some(x) = args.vf64 { builder.add_vf64(x); }
2045 if let Some(x) = args.v8 { builder.add_v8(x); }
2046 builder.add_f32_(args.f32_);
2047 builder.add_u32_(args.u32_);
2048 builder.add_i32_(args.i32_);
2049 builder.add_u16_(args.u16_);
2050 builder.add_i16_(args.i16_);
2051 builder.add_u8_(args.u8_);
2052 builder.add_i8_(args.i8_);
2053 builder.finish()
2054 }
2055
2056 pub const VT_I8_: flatbuffers::VOffsetT = 4;
2057 pub const VT_U8_: flatbuffers::VOffsetT = 6;
2058 pub const VT_I16_: flatbuffers::VOffsetT = 8;
2059 pub const VT_U16_: flatbuffers::VOffsetT = 10;
2060 pub const VT_I32_: flatbuffers::VOffsetT = 12;
2061 pub const VT_U32_: flatbuffers::VOffsetT = 14;
2062 pub const VT_I64_: flatbuffers::VOffsetT = 16;
2063 pub const VT_U64_: flatbuffers::VOffsetT = 18;
2064 pub const VT_F32_: flatbuffers::VOffsetT = 20;
2065 pub const VT_F64_: flatbuffers::VOffsetT = 22;
2066 pub const VT_V8: flatbuffers::VOffsetT = 24;
2067 pub const VT_VF64: flatbuffers::VOffsetT = 26;
2068
2069 #[inline]
2070 pub fn i8_(&self) -> i8 {
2071 self._tab.get::<i8>(TypeAliases::VT_I8_, Some(0)).unwrap()
2072 }
2073 #[inline]
2074 pub fn u8_(&self) -> u8 {
2075 self._tab.get::<u8>(TypeAliases::VT_U8_, Some(0)).unwrap()
2076 }
2077 #[inline]
2078 pub fn i16_(&self) -> i16 {
2079 self._tab.get::<i16>(TypeAliases::VT_I16_, Some(0)).unwrap()
2080 }
2081 #[inline]
2082 pub fn u16_(&self) -> u16 {
2083 self._tab.get::<u16>(TypeAliases::VT_U16_, Some(0)).unwrap()
2084 }
2085 #[inline]
2086 pub fn i32_(&self) -> i32 {
2087 self._tab.get::<i32>(TypeAliases::VT_I32_, Some(0)).unwrap()
2088 }
2089 #[inline]
2090 pub fn u32_(&self) -> u32 {
2091 self._tab.get::<u32>(TypeAliases::VT_U32_, Some(0)).unwrap()
2092 }
2093 #[inline]
2094 pub fn i64_(&self) -> i64 {
2095 self._tab.get::<i64>(TypeAliases::VT_I64_, Some(0)).unwrap()
2096 }
2097 #[inline]
2098 pub fn u64_(&self) -> u64 {
2099 self._tab.get::<u64>(TypeAliases::VT_U64_, Some(0)).unwrap()
2100 }
2101 #[inline]
2102 pub fn f32_(&self) -> f32 {
2103 self._tab.get::<f32>(TypeAliases::VT_F32_, Some(0.0)).unwrap()
2104 }
2105 #[inline]
2106 pub fn f64_(&self) -> f64 {
2107 self._tab.get::<f64>(TypeAliases::VT_F64_, Some(0.0)).unwrap()
2108 }
2109 #[inline]
2110 pub fn v8(&self) -> Option<&'a [i8]> {
2111 self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, i8>>>(TypeAliases::VT_V8, None).map(|v| v.safe_slice())
2112 }
2113 #[inline]
2114 pub fn vf64(&self) -> Option<flatbuffers::Vector<'a, f64>> {
2115 self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, f64>>>(TypeAliases::VT_VF64, None)
2116 }
2117}
2118
2119pub struct TypeAliasesArgs<'a> {
2120 pub i8_: i8,
2121 pub u8_: u8,
2122 pub i16_: i16,
2123 pub u16_: u16,
2124 pub i32_: i32,
2125 pub u32_: u32,
2126 pub i64_: i64,
2127 pub u64_: u64,
2128 pub f32_: f32,
2129 pub f64_: f64,
Austin Schuh272c6132020-11-14 16:37:52 -08002130 pub v8: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, i8>>>,
2131 pub vf64: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, f64>>>,
Austin Schuhe89fa2d2019-08-14 20:24:23 -07002132}
2133impl<'a> Default for TypeAliasesArgs<'a> {
2134 #[inline]
2135 fn default() -> Self {
2136 TypeAliasesArgs {
2137 i8_: 0,
2138 u8_: 0,
2139 i16_: 0,
2140 u16_: 0,
2141 i32_: 0,
2142 u32_: 0,
2143 i64_: 0,
2144 u64_: 0,
2145 f32_: 0.0,
2146 f64_: 0.0,
2147 v8: None,
2148 vf64: None,
2149 }
2150 }
2151}
2152pub struct TypeAliasesBuilder<'a: 'b, 'b> {
2153 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a>,
2154 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
2155}
2156impl<'a: 'b, 'b> TypeAliasesBuilder<'a, 'b> {
2157 #[inline]
2158 pub fn add_i8_(&mut self, i8_: i8) {
2159 self.fbb_.push_slot::<i8>(TypeAliases::VT_I8_, i8_, 0);
2160 }
2161 #[inline]
2162 pub fn add_u8_(&mut self, u8_: u8) {
2163 self.fbb_.push_slot::<u8>(TypeAliases::VT_U8_, u8_, 0);
2164 }
2165 #[inline]
2166 pub fn add_i16_(&mut self, i16_: i16) {
2167 self.fbb_.push_slot::<i16>(TypeAliases::VT_I16_, i16_, 0);
2168 }
2169 #[inline]
2170 pub fn add_u16_(&mut self, u16_: u16) {
2171 self.fbb_.push_slot::<u16>(TypeAliases::VT_U16_, u16_, 0);
2172 }
2173 #[inline]
2174 pub fn add_i32_(&mut self, i32_: i32) {
2175 self.fbb_.push_slot::<i32>(TypeAliases::VT_I32_, i32_, 0);
2176 }
2177 #[inline]
2178 pub fn add_u32_(&mut self, u32_: u32) {
2179 self.fbb_.push_slot::<u32>(TypeAliases::VT_U32_, u32_, 0);
2180 }
2181 #[inline]
2182 pub fn add_i64_(&mut self, i64_: i64) {
2183 self.fbb_.push_slot::<i64>(TypeAliases::VT_I64_, i64_, 0);
2184 }
2185 #[inline]
2186 pub fn add_u64_(&mut self, u64_: u64) {
2187 self.fbb_.push_slot::<u64>(TypeAliases::VT_U64_, u64_, 0);
2188 }
2189 #[inline]
2190 pub fn add_f32_(&mut self, f32_: f32) {
2191 self.fbb_.push_slot::<f32>(TypeAliases::VT_F32_, f32_, 0.0);
2192 }
2193 #[inline]
2194 pub fn add_f64_(&mut self, f64_: f64) {
2195 self.fbb_.push_slot::<f64>(TypeAliases::VT_F64_, f64_, 0.0);
2196 }
2197 #[inline]
2198 pub fn add_v8(&mut self, v8: flatbuffers::WIPOffset<flatbuffers::Vector<'b , i8>>) {
2199 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(TypeAliases::VT_V8, v8);
2200 }
2201 #[inline]
2202 pub fn add_vf64(&mut self, vf64: flatbuffers::WIPOffset<flatbuffers::Vector<'b , f64>>) {
2203 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(TypeAliases::VT_VF64, vf64);
2204 }
2205 #[inline]
2206 pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> TypeAliasesBuilder<'a, 'b> {
2207 let start = _fbb.start_table();
2208 TypeAliasesBuilder {
2209 fbb_: _fbb,
2210 start_: start,
2211 }
2212 }
2213 #[inline]
2214 pub fn finish(self) -> flatbuffers::WIPOffset<TypeAliases<'a>> {
2215 let o = self.fbb_.end_table(self.start_);
2216 flatbuffers::WIPOffset::new(o.value())
2217 }
2218}
2219
Austin Schuh272c6132020-11-14 16:37:52 -08002220impl std::fmt::Debug for TypeAliases<'_> {
2221 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2222 let mut ds = f.debug_struct("TypeAliases");
2223 ds.field("i8_", &self.i8_());
2224 ds.field("u8_", &self.u8_());
2225 ds.field("i16_", &self.i16_());
2226 ds.field("u16_", &self.u16_());
2227 ds.field("i32_", &self.i32_());
2228 ds.field("u32_", &self.u32_());
2229 ds.field("i64_", &self.i64_());
2230 ds.field("u64_", &self.u64_());
2231 ds.field("f32_", &self.f32_());
2232 ds.field("f64_", &self.f64_());
2233 ds.field("v8", &self.v8());
2234 ds.field("vf64", &self.vf64());
2235 ds.finish()
2236 }
2237}
Austin Schuhe89fa2d2019-08-14 20:24:23 -07002238#[inline]
2239pub fn get_root_as_monster<'a>(buf: &'a [u8]) -> Monster<'a> {
2240 flatbuffers::get_root::<Monster<'a>>(buf)
2241}
2242
2243#[inline]
2244pub fn get_size_prefixed_root_as_monster<'a>(buf: &'a [u8]) -> Monster<'a> {
2245 flatbuffers::get_size_prefixed_root::<Monster<'a>>(buf)
2246}
2247
Austin Schuh272c6132020-11-14 16:37:52 -08002248pub const MONSTER_IDENTIFIER: &str = "MONS";
Austin Schuhe89fa2d2019-08-14 20:24:23 -07002249
2250#[inline]
2251pub fn monster_buffer_has_identifier(buf: &[u8]) -> bool {
Austin Schuh272c6132020-11-14 16:37:52 -08002252 flatbuffers::buffer_has_identifier(buf, MONSTER_IDENTIFIER, false)
Austin Schuhe89fa2d2019-08-14 20:24:23 -07002253}
2254
2255#[inline]
2256pub fn monster_size_prefixed_buffer_has_identifier(buf: &[u8]) -> bool {
Austin Schuh272c6132020-11-14 16:37:52 -08002257 flatbuffers::buffer_has_identifier(buf, MONSTER_IDENTIFIER, true)
Austin Schuhe89fa2d2019-08-14 20:24:23 -07002258}
2259
Austin Schuh272c6132020-11-14 16:37:52 -08002260pub const MONSTER_EXTENSION: &str = "mon";
Austin Schuhe89fa2d2019-08-14 20:24:23 -07002261
2262#[inline]
2263pub fn finish_monster_buffer<'a, 'b>(
2264 fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>,
2265 root: flatbuffers::WIPOffset<Monster<'a>>) {
2266 fbb.finish(root, Some(MONSTER_IDENTIFIER));
2267}
2268
2269#[inline]
2270pub fn finish_size_prefixed_monster_buffer<'a, 'b>(fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>, root: flatbuffers::WIPOffset<Monster<'a>>) {
2271 fbb.finish_size_prefixed(root, Some(MONSTER_IDENTIFIER));
2272}
2273} // pub mod Example
2274} // pub mod MyGame
2275