1 // automatically generated by the FlatBuffers compiler, do not modify
2
3
4
5 use std::mem;
6 use std::cmp::Ordering;
7
8 extern crate flatbuffers;
9 use self::flatbuffers::EndianScalar;
10
11 #[allow(unused_imports, dead_code)]
12 pub mod my_game {
13
14 use std::mem;
15 use std::cmp::Ordering;
16
17 extern crate flatbuffers;
18 use self::flatbuffers::EndianScalar;
19
20 pub enum InParentNamespaceOffset {}
21 #[derive(Copy, Clone, Debug, PartialEq)]
22
23 pub struct InParentNamespace<'a> {
24 pub _tab: flatbuffers::Table<'a>,
25 }
26
27 impl<'a> flatbuffers::Follow<'a> for InParentNamespace<'a> {
28 type Inner = InParentNamespace<'a>;
29 #[inline]
follow(buf: &'a [u8], loc: usize) -> Self::Inner30 fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
31 Self {
32 _tab: flatbuffers::Table { buf: buf, loc: loc },
33 }
34 }
35 }
36
37 impl<'a> InParentNamespace<'a> {
38 #[inline]
init_from_table(table: flatbuffers::Table<'a>) -> Self39 pub fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
40 InParentNamespace {
41 _tab: table,
42 }
43 }
44 #[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>>45 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>(
46 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>,
47 _args: &'args InParentNamespaceArgs) -> flatbuffers::WIPOffset<InParentNamespace<'bldr>> {
48 let mut builder = InParentNamespaceBuilder::new(_fbb);
49 builder.finish()
50 }
51
52 }
53
54 pub struct InParentNamespaceArgs {
55 }
56 impl<'a> Default for InParentNamespaceArgs {
57 #[inline]
default() -> Self58 fn default() -> Self {
59 InParentNamespaceArgs {
60 }
61 }
62 }
63 pub struct InParentNamespaceBuilder<'a: 'b, 'b> {
64 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a>,
65 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
66 }
67 impl<'a: 'b, 'b> InParentNamespaceBuilder<'a, 'b> {
68 #[inline]
new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> InParentNamespaceBuilder<'a, 'b>69 pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> InParentNamespaceBuilder<'a, 'b> {
70 let start = _fbb.start_table();
71 InParentNamespaceBuilder {
72 fbb_: _fbb,
73 start_: start,
74 }
75 }
76 #[inline]
finish(self) -> flatbuffers::WIPOffset<InParentNamespace<'a>>77 pub fn finish(self) -> flatbuffers::WIPOffset<InParentNamespace<'a>> {
78 let o = self.fbb_.end_table(self.start_);
79 flatbuffers::WIPOffset::new(o.value())
80 }
81 }
82
83 #[allow(unused_imports, dead_code)]
84 pub mod example_2 {
85
86 use std::mem;
87 use std::cmp::Ordering;
88
89 extern crate flatbuffers;
90 use self::flatbuffers::EndianScalar;
91
92 pub enum MonsterOffset {}
93 #[derive(Copy, Clone, Debug, PartialEq)]
94
95 pub struct Monster<'a> {
96 pub _tab: flatbuffers::Table<'a>,
97 }
98
99 impl<'a> flatbuffers::Follow<'a> for Monster<'a> {
100 type Inner = Monster<'a>;
101 #[inline]
follow(buf: &'a [u8], loc: usize) -> Self::Inner102 fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
103 Self {
104 _tab: flatbuffers::Table { buf: buf, loc: loc },
105 }
106 }
107 }
108
109 impl<'a> Monster<'a> {
110 #[inline]
init_from_table(table: flatbuffers::Table<'a>) -> Self111 pub fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
112 Monster {
113 _tab: table,
114 }
115 }
116 #[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>>117 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>(
118 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>,
119 _args: &'args MonsterArgs) -> flatbuffers::WIPOffset<Monster<'bldr>> {
120 let mut builder = MonsterBuilder::new(_fbb);
121 builder.finish()
122 }
123
124 }
125
126 pub struct MonsterArgs {
127 }
128 impl<'a> Default for MonsterArgs {
129 #[inline]
default() -> Self130 fn default() -> Self {
131 MonsterArgs {
132 }
133 }
134 }
135 pub struct MonsterBuilder<'a: 'b, 'b> {
136 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a>,
137 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
138 }
139 impl<'a: 'b, 'b> MonsterBuilder<'a, 'b> {
140 #[inline]
new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> MonsterBuilder<'a, 'b>141 pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> MonsterBuilder<'a, 'b> {
142 let start = _fbb.start_table();
143 MonsterBuilder {
144 fbb_: _fbb,
145 start_: start,
146 }
147 }
148 #[inline]
finish(self) -> flatbuffers::WIPOffset<Monster<'a>>149 pub fn finish(self) -> flatbuffers::WIPOffset<Monster<'a>> {
150 let o = self.fbb_.end_table(self.start_);
151 flatbuffers::WIPOffset::new(o.value())
152 }
153 }
154
155 } // pub mod Example2
156
157 #[allow(unused_imports, dead_code)]
158 pub mod example {
159
160 use std::mem;
161 use std::cmp::Ordering;
162
163 extern crate flatbuffers;
164 use self::flatbuffers::EndianScalar;
165
166 #[allow(non_camel_case_types)]
167 #[repr(i8)]
168 #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)]
169 pub enum Color {
170 Red = 1,
171 Green = 2,
172 Blue = 8,
173
174 }
175
176 const ENUM_MIN_COLOR: i8 = 1;
177 const ENUM_MAX_COLOR: i8 = 8;
178
179 impl<'a> flatbuffers::Follow<'a> for Color {
180 type Inner = Self;
181 #[inline]
follow(buf: &'a [u8], loc: usize) -> Self::Inner182 fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
183 flatbuffers::read_scalar_at::<Self>(buf, loc)
184 }
185 }
186
187 impl flatbuffers::EndianScalar for Color {
188 #[inline]
to_little_endian(self) -> Self189 fn to_little_endian(self) -> Self {
190 let n = i8::to_le(self as i8);
191 let p = &n as *const i8 as *const Color;
192 unsafe { *p }
193 }
194 #[inline]
from_little_endian(self) -> Self195 fn from_little_endian(self) -> Self {
196 let n = i8::from_le(self as i8);
197 let p = &n as *const i8 as *const Color;
198 unsafe { *p }
199 }
200 }
201
202 impl flatbuffers::Push for Color {
203 type Output = Color;
204 #[inline]
push(&self, dst: &mut [u8], _rest: &[u8])205 fn push(&self, dst: &mut [u8], _rest: &[u8]) {
206 flatbuffers::emplace_scalar::<Color>(dst, *self);
207 }
208 }
209
210 #[allow(non_camel_case_types)]
211 const ENUM_VALUES_COLOR:[Color; 3] = [
212 Color::Red,
213 Color::Green,
214 Color::Blue
215 ];
216
217 #[allow(non_camel_case_types)]
218 const ENUM_NAMES_COLOR:[&'static str; 8] = [
219 "Red",
220 "Green",
221 "",
222 "",
223 "",
224 "",
225 "",
226 "Blue"
227 ];
228
enum_name_color(e: Color) -> &'static str229 pub fn enum_name_color(e: Color) -> &'static str {
230 let index = e as i8 - Color::Red as i8;
231 ENUM_NAMES_COLOR[index as usize]
232 }
233
234 #[allow(non_camel_case_types)]
235 #[repr(u8)]
236 #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)]
237 pub enum Any {
238 NONE = 0,
239 Monster = 1,
240 TestSimpleTableWithEnum = 2,
241 MyGame_Example2_Monster = 3,
242
243 }
244
245 const ENUM_MIN_ANY: u8 = 0;
246 const ENUM_MAX_ANY: u8 = 3;
247
248 impl<'a> flatbuffers::Follow<'a> for Any {
249 type Inner = Self;
250 #[inline]
follow(buf: &'a [u8], loc: usize) -> Self::Inner251 fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
252 flatbuffers::read_scalar_at::<Self>(buf, loc)
253 }
254 }
255
256 impl flatbuffers::EndianScalar for Any {
257 #[inline]
to_little_endian(self) -> Self258 fn to_little_endian(self) -> Self {
259 let n = u8::to_le(self as u8);
260 let p = &n as *const u8 as *const Any;
261 unsafe { *p }
262 }
263 #[inline]
from_little_endian(self) -> Self264 fn from_little_endian(self) -> Self {
265 let n = u8::from_le(self as u8);
266 let p = &n as *const u8 as *const Any;
267 unsafe { *p }
268 }
269 }
270
271 impl flatbuffers::Push for Any {
272 type Output = Any;
273 #[inline]
push(&self, dst: &mut [u8], _rest: &[u8])274 fn push(&self, dst: &mut [u8], _rest: &[u8]) {
275 flatbuffers::emplace_scalar::<Any>(dst, *self);
276 }
277 }
278
279 #[allow(non_camel_case_types)]
280 const ENUM_VALUES_ANY:[Any; 4] = [
281 Any::NONE,
282 Any::Monster,
283 Any::TestSimpleTableWithEnum,
284 Any::MyGame_Example2_Monster
285 ];
286
287 #[allow(non_camel_case_types)]
288 const ENUM_NAMES_ANY:[&'static str; 4] = [
289 "NONE",
290 "Monster",
291 "TestSimpleTableWithEnum",
292 "MyGame_Example2_Monster"
293 ];
294
enum_name_any(e: Any) -> &'static str295 pub fn enum_name_any(e: Any) -> &'static str {
296 let index = e as u8;
297 ENUM_NAMES_ANY[index as usize]
298 }
299
300 pub struct AnyUnionTableOffset {}
301 #[allow(non_camel_case_types)]
302 #[repr(u8)]
303 #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)]
304 pub enum AnyUniqueAliases {
305 NONE = 0,
306 M = 1,
307 T = 2,
308 M2 = 3,
309
310 }
311
312 const ENUM_MIN_ANY_UNIQUE_ALIASES: u8 = 0;
313 const ENUM_MAX_ANY_UNIQUE_ALIASES: u8 = 3;
314
315 impl<'a> flatbuffers::Follow<'a> for AnyUniqueAliases {
316 type Inner = Self;
317 #[inline]
follow(buf: &'a [u8], loc: usize) -> Self::Inner318 fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
319 flatbuffers::read_scalar_at::<Self>(buf, loc)
320 }
321 }
322
323 impl flatbuffers::EndianScalar for AnyUniqueAliases {
324 #[inline]
to_little_endian(self) -> Self325 fn to_little_endian(self) -> Self {
326 let n = u8::to_le(self as u8);
327 let p = &n as *const u8 as *const AnyUniqueAliases;
328 unsafe { *p }
329 }
330 #[inline]
from_little_endian(self) -> Self331 fn from_little_endian(self) -> Self {
332 let n = u8::from_le(self as u8);
333 let p = &n as *const u8 as *const AnyUniqueAliases;
334 unsafe { *p }
335 }
336 }
337
338 impl flatbuffers::Push for AnyUniqueAliases {
339 type Output = AnyUniqueAliases;
340 #[inline]
push(&self, dst: &mut [u8], _rest: &[u8])341 fn push(&self, dst: &mut [u8], _rest: &[u8]) {
342 flatbuffers::emplace_scalar::<AnyUniqueAliases>(dst, *self);
343 }
344 }
345
346 #[allow(non_camel_case_types)]
347 const ENUM_VALUES_ANY_UNIQUE_ALIASES:[AnyUniqueAliases; 4] = [
348 AnyUniqueAliases::NONE,
349 AnyUniqueAliases::M,
350 AnyUniqueAliases::T,
351 AnyUniqueAliases::M2
352 ];
353
354 #[allow(non_camel_case_types)]
355 const ENUM_NAMES_ANY_UNIQUE_ALIASES:[&'static str; 4] = [
356 "NONE",
357 "M",
358 "T",
359 "M2"
360 ];
361
enum_name_any_unique_aliases(e: AnyUniqueAliases) -> &'static str362 pub fn enum_name_any_unique_aliases(e: AnyUniqueAliases) -> &'static str {
363 let index = e as u8;
364 ENUM_NAMES_ANY_UNIQUE_ALIASES[index as usize]
365 }
366
367 pub struct AnyUniqueAliasesUnionTableOffset {}
368 #[allow(non_camel_case_types)]
369 #[repr(u8)]
370 #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)]
371 pub enum AnyAmbiguousAliases {
372 NONE = 0,
373 M1 = 1,
374 M2 = 2,
375 M3 = 3,
376
377 }
378
379 const ENUM_MIN_ANY_AMBIGUOUS_ALIASES: u8 = 0;
380 const ENUM_MAX_ANY_AMBIGUOUS_ALIASES: u8 = 3;
381
382 impl<'a> flatbuffers::Follow<'a> for AnyAmbiguousAliases {
383 type Inner = Self;
384 #[inline]
follow(buf: &'a [u8], loc: usize) -> Self::Inner385 fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
386 flatbuffers::read_scalar_at::<Self>(buf, loc)
387 }
388 }
389
390 impl flatbuffers::EndianScalar for AnyAmbiguousAliases {
391 #[inline]
to_little_endian(self) -> Self392 fn to_little_endian(self) -> Self {
393 let n = u8::to_le(self as u8);
394 let p = &n as *const u8 as *const AnyAmbiguousAliases;
395 unsafe { *p }
396 }
397 #[inline]
from_little_endian(self) -> Self398 fn from_little_endian(self) -> Self {
399 let n = u8::from_le(self as u8);
400 let p = &n as *const u8 as *const AnyAmbiguousAliases;
401 unsafe { *p }
402 }
403 }
404
405 impl flatbuffers::Push for AnyAmbiguousAliases {
406 type Output = AnyAmbiguousAliases;
407 #[inline]
push(&self, dst: &mut [u8], _rest: &[u8])408 fn push(&self, dst: &mut [u8], _rest: &[u8]) {
409 flatbuffers::emplace_scalar::<AnyAmbiguousAliases>(dst, *self);
410 }
411 }
412
413 #[allow(non_camel_case_types)]
414 const ENUM_VALUES_ANY_AMBIGUOUS_ALIASES:[AnyAmbiguousAliases; 4] = [
415 AnyAmbiguousAliases::NONE,
416 AnyAmbiguousAliases::M1,
417 AnyAmbiguousAliases::M2,
418 AnyAmbiguousAliases::M3
419 ];
420
421 #[allow(non_camel_case_types)]
422 const ENUM_NAMES_ANY_AMBIGUOUS_ALIASES:[&'static str; 4] = [
423 "NONE",
424 "M1",
425 "M2",
426 "M3"
427 ];
428
enum_name_any_ambiguous_aliases(e: AnyAmbiguousAliases) -> &'static str429 pub fn enum_name_any_ambiguous_aliases(e: AnyAmbiguousAliases) -> &'static str {
430 let index = e as u8;
431 ENUM_NAMES_ANY_AMBIGUOUS_ALIASES[index as usize]
432 }
433
434 pub struct AnyAmbiguousAliasesUnionTableOffset {}
435 // struct Test, aligned to 2
436 #[repr(C, align(2))]
437 #[derive(Clone, Copy, Debug, PartialEq)]
438 pub struct Test {
439 a_: i16,
440 b_: i8,
441 padding0__: u8,
442 } // pub struct Test
443 impl flatbuffers::SafeSliceAccess for Test {}
444 impl<'a> flatbuffers::Follow<'a> for Test {
445 type Inner = &'a Test;
446 #[inline]
follow(buf: &'a [u8], loc: usize) -> Self::Inner447 fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
448 <&'a Test>::follow(buf, loc)
449 }
450 }
451 impl<'a> flatbuffers::Follow<'a> for &'a Test {
452 type Inner = &'a Test;
453 #[inline]
follow(buf: &'a [u8], loc: usize) -> Self::Inner454 fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
455 flatbuffers::follow_cast_ref::<Test>(buf, loc)
456 }
457 }
458 impl<'b> flatbuffers::Push for Test {
459 type Output = Test;
460 #[inline]
push(&self, dst: &mut [u8], _rest: &[u8])461 fn push(&self, dst: &mut [u8], _rest: &[u8]) {
462 let src = unsafe {
463 ::std::slice::from_raw_parts(self as *const Test as *const u8, Self::size())
464 };
465 dst.copy_from_slice(src);
466 }
467 }
468 impl<'b> flatbuffers::Push for &'b Test {
469 type Output = Test;
470
471 #[inline]
push(&self, dst: &mut [u8], _rest: &[u8])472 fn push(&self, dst: &mut [u8], _rest: &[u8]) {
473 let src = unsafe {
474 ::std::slice::from_raw_parts(*self as *const Test as *const u8, Self::size())
475 };
476 dst.copy_from_slice(src);
477 }
478 }
479
480
481 impl Test {
new<'a>(_a: i16, _b: i8) -> Self482 pub fn new<'a>(_a: i16, _b: i8) -> Self {
483 Test {
484 a_: _a.to_little_endian(),
485 b_: _b.to_little_endian(),
486
487 padding0__: 0,
488 }
489 }
a<'a>(&'a self) -> i16490 pub fn a<'a>(&'a self) -> i16 {
491 self.a_.from_little_endian()
492 }
b<'a>(&'a self) -> i8493 pub fn b<'a>(&'a self) -> i8 {
494 self.b_.from_little_endian()
495 }
496 }
497
498 // struct Vec3, aligned to 8
499 #[repr(C, align(8))]
500 #[derive(Clone, Copy, Debug, PartialEq)]
501 pub struct Vec3 {
502 x_: f32,
503 y_: f32,
504 z_: f32,
505 padding0__: u32,
506 test1_: f64,
507 test2_: Color,
508 padding1__: u8,
509 test3_: Test,
510 padding2__: u16,
511 } // pub struct Vec3
512 impl flatbuffers::SafeSliceAccess for Vec3 {}
513 impl<'a> flatbuffers::Follow<'a> for Vec3 {
514 type Inner = &'a Vec3;
515 #[inline]
follow(buf: &'a [u8], loc: usize) -> Self::Inner516 fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
517 <&'a Vec3>::follow(buf, loc)
518 }
519 }
520 impl<'a> flatbuffers::Follow<'a> for &'a Vec3 {
521 type Inner = &'a Vec3;
522 #[inline]
follow(buf: &'a [u8], loc: usize) -> Self::Inner523 fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
524 flatbuffers::follow_cast_ref::<Vec3>(buf, loc)
525 }
526 }
527 impl<'b> flatbuffers::Push for Vec3 {
528 type Output = Vec3;
529 #[inline]
push(&self, dst: &mut [u8], _rest: &[u8])530 fn push(&self, dst: &mut [u8], _rest: &[u8]) {
531 let src = unsafe {
532 ::std::slice::from_raw_parts(self as *const Vec3 as *const u8, Self::size())
533 };
534 dst.copy_from_slice(src);
535 }
536 }
537 impl<'b> flatbuffers::Push for &'b Vec3 {
538 type Output = Vec3;
539
540 #[inline]
push(&self, dst: &mut [u8], _rest: &[u8])541 fn push(&self, dst: &mut [u8], _rest: &[u8]) {
542 let src = unsafe {
543 ::std::slice::from_raw_parts(*self as *const Vec3 as *const u8, Self::size())
544 };
545 dst.copy_from_slice(src);
546 }
547 }
548
549
550 impl Vec3 {
new<'a>(_x: f32, _y: f32, _z: f32, _test1: f64, _test2: Color, _test3: &'a Test) -> Self551 pub fn new<'a>(_x: f32, _y: f32, _z: f32, _test1: f64, _test2: Color, _test3: &'a Test) -> Self {
552 Vec3 {
553 x_: _x.to_little_endian(),
554 y_: _y.to_little_endian(),
555 z_: _z.to_little_endian(),
556 test1_: _test1.to_little_endian(),
557 test2_: _test2.to_little_endian(),
558 test3_: *_test3,
559
560 padding0__: 0,
561 padding1__: 0,
562 padding2__: 0,
563 }
564 }
x<'a>(&'a self) -> f32565 pub fn x<'a>(&'a self) -> f32 {
566 self.x_.from_little_endian()
567 }
y<'a>(&'a self) -> f32568 pub fn y<'a>(&'a self) -> f32 {
569 self.y_.from_little_endian()
570 }
z<'a>(&'a self) -> f32571 pub fn z<'a>(&'a self) -> f32 {
572 self.z_.from_little_endian()
573 }
test1<'a>(&'a self) -> f64574 pub fn test1<'a>(&'a self) -> f64 {
575 self.test1_.from_little_endian()
576 }
test2<'a>(&'a self) -> Color577 pub fn test2<'a>(&'a self) -> Color {
578 self.test2_.from_little_endian()
579 }
test3<'a>(&'a self) -> &'a Test580 pub fn test3<'a>(&'a self) -> &'a Test {
581 &self.test3_
582 }
583 }
584
585 // struct Ability, aligned to 4
586 #[repr(C, align(4))]
587 #[derive(Clone, Copy, Debug, PartialEq)]
588 pub struct Ability {
589 id_: u32,
590 distance_: u32,
591 } // pub struct Ability
592 impl flatbuffers::SafeSliceAccess for Ability {}
593 impl<'a> flatbuffers::Follow<'a> for Ability {
594 type Inner = &'a Ability;
595 #[inline]
follow(buf: &'a [u8], loc: usize) -> Self::Inner596 fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
597 <&'a Ability>::follow(buf, loc)
598 }
599 }
600 impl<'a> flatbuffers::Follow<'a> for &'a Ability {
601 type Inner = &'a Ability;
602 #[inline]
follow(buf: &'a [u8], loc: usize) -> Self::Inner603 fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
604 flatbuffers::follow_cast_ref::<Ability>(buf, loc)
605 }
606 }
607 impl<'b> flatbuffers::Push for Ability {
608 type Output = Ability;
609 #[inline]
push(&self, dst: &mut [u8], _rest: &[u8])610 fn push(&self, dst: &mut [u8], _rest: &[u8]) {
611 let src = unsafe {
612 ::std::slice::from_raw_parts(self as *const Ability as *const u8, Self::size())
613 };
614 dst.copy_from_slice(src);
615 }
616 }
617 impl<'b> flatbuffers::Push for &'b Ability {
618 type Output = Ability;
619
620 #[inline]
push(&self, dst: &mut [u8], _rest: &[u8])621 fn push(&self, dst: &mut [u8], _rest: &[u8]) {
622 let src = unsafe {
623 ::std::slice::from_raw_parts(*self as *const Ability as *const u8, Self::size())
624 };
625 dst.copy_from_slice(src);
626 }
627 }
628
629
630 impl Ability {
new<'a>(_id: u32, _distance: u32) -> Self631 pub fn new<'a>(_id: u32, _distance: u32) -> Self {
632 Ability {
633 id_: _id.to_little_endian(),
634 distance_: _distance.to_little_endian(),
635
636 }
637 }
id<'a>(&'a self) -> u32638 pub fn id<'a>(&'a self) -> u32 {
639 self.id_.from_little_endian()
640 }
641 #[inline]
key_compare_less_than(&self, o: &Ability) -> bool642 pub fn key_compare_less_than(&self, o: &Ability) -> bool {
643 self.id() < o.id()
644 }
645
646 #[inline]
key_compare_with_value(&self, val: u32) -> ::std::cmp::Ordering647 pub fn key_compare_with_value(&self, val: u32) -> ::std::cmp::Ordering {
648 let key = self.id();
649 key.cmp(&val)
650 }
distance<'a>(&'a self) -> u32651 pub fn distance<'a>(&'a self) -> u32 {
652 self.distance_.from_little_endian()
653 }
654 }
655
656 pub enum TestSimpleTableWithEnumOffset {}
657 #[derive(Copy, Clone, Debug, PartialEq)]
658
659 pub struct TestSimpleTableWithEnum<'a> {
660 pub _tab: flatbuffers::Table<'a>,
661 }
662
663 impl<'a> flatbuffers::Follow<'a> for TestSimpleTableWithEnum<'a> {
664 type Inner = TestSimpleTableWithEnum<'a>;
665 #[inline]
follow(buf: &'a [u8], loc: usize) -> Self::Inner666 fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
667 Self {
668 _tab: flatbuffers::Table { buf: buf, loc: loc },
669 }
670 }
671 }
672
673 impl<'a> TestSimpleTableWithEnum<'a> {
674 #[inline]
init_from_table(table: flatbuffers::Table<'a>) -> Self675 pub fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
676 TestSimpleTableWithEnum {
677 _tab: table,
678 }
679 }
680 #[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>>681 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>(
682 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>,
683 args: &'args TestSimpleTableWithEnumArgs) -> flatbuffers::WIPOffset<TestSimpleTableWithEnum<'bldr>> {
684 let mut builder = TestSimpleTableWithEnumBuilder::new(_fbb);
685 builder.add_color(args.color);
686 builder.finish()
687 }
688
689 pub const VT_COLOR: flatbuffers::VOffsetT = 4;
690
691 #[inline]
color(&self) -> Color692 pub fn color(&self) -> Color {
693 self._tab.get::<Color>(TestSimpleTableWithEnum::VT_COLOR, Some(Color::Green)).unwrap()
694 }
695 }
696
697 pub struct TestSimpleTableWithEnumArgs {
698 pub color: Color,
699 }
700 impl<'a> Default for TestSimpleTableWithEnumArgs {
701 #[inline]
default() -> Self702 fn default() -> Self {
703 TestSimpleTableWithEnumArgs {
704 color: Color::Green,
705 }
706 }
707 }
708 pub struct TestSimpleTableWithEnumBuilder<'a: 'b, 'b> {
709 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a>,
710 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
711 }
712 impl<'a: 'b, 'b> TestSimpleTableWithEnumBuilder<'a, 'b> {
713 #[inline]
add_color(&mut self, color: Color)714 pub fn add_color(&mut self, color: Color) {
715 self.fbb_.push_slot::<Color>(TestSimpleTableWithEnum::VT_COLOR, color, Color::Green);
716 }
717 #[inline]
new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> TestSimpleTableWithEnumBuilder<'a, 'b>718 pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> TestSimpleTableWithEnumBuilder<'a, 'b> {
719 let start = _fbb.start_table();
720 TestSimpleTableWithEnumBuilder {
721 fbb_: _fbb,
722 start_: start,
723 }
724 }
725 #[inline]
finish(self) -> flatbuffers::WIPOffset<TestSimpleTableWithEnum<'a>>726 pub fn finish(self) -> flatbuffers::WIPOffset<TestSimpleTableWithEnum<'a>> {
727 let o = self.fbb_.end_table(self.start_);
728 flatbuffers::WIPOffset::new(o.value())
729 }
730 }
731
732 pub enum StatOffset {}
733 #[derive(Copy, Clone, Debug, PartialEq)]
734
735 pub struct Stat<'a> {
736 pub _tab: flatbuffers::Table<'a>,
737 }
738
739 impl<'a> flatbuffers::Follow<'a> for Stat<'a> {
740 type Inner = Stat<'a>;
741 #[inline]
follow(buf: &'a [u8], loc: usize) -> Self::Inner742 fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
743 Self {
744 _tab: flatbuffers::Table { buf: buf, loc: loc },
745 }
746 }
747 }
748
749 impl<'a> Stat<'a> {
750 #[inline]
init_from_table(table: flatbuffers::Table<'a>) -> Self751 pub fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
752 Stat {
753 _tab: table,
754 }
755 }
756 #[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>>757 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>(
758 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>,
759 args: &'args StatArgs<'args>) -> flatbuffers::WIPOffset<Stat<'bldr>> {
760 let mut builder = StatBuilder::new(_fbb);
761 builder.add_val(args.val);
762 if let Some(x) = args.id { builder.add_id(x); }
763 builder.add_count(args.count);
764 builder.finish()
765 }
766
767 pub const VT_ID: flatbuffers::VOffsetT = 4;
768 pub const VT_VAL: flatbuffers::VOffsetT = 6;
769 pub const VT_COUNT: flatbuffers::VOffsetT = 8;
770
771 #[inline]
id(&self) -> Option<&'a str>772 pub fn id(&self) -> Option<&'a str> {
773 self._tab.get::<flatbuffers::ForwardsUOffset<&str>>(Stat::VT_ID, None)
774 }
775 #[inline]
val(&self) -> i64776 pub fn val(&self) -> i64 {
777 self._tab.get::<i64>(Stat::VT_VAL, Some(0)).unwrap()
778 }
779 #[inline]
count(&self) -> u16780 pub fn count(&self) -> u16 {
781 self._tab.get::<u16>(Stat::VT_COUNT, Some(0)).unwrap()
782 }
783 }
784
785 pub struct StatArgs<'a> {
786 pub id: Option<flatbuffers::WIPOffset<&'a str>>,
787 pub val: i64,
788 pub count: u16,
789 }
790 impl<'a> Default for StatArgs<'a> {
791 #[inline]
default() -> Self792 fn default() -> Self {
793 StatArgs {
794 id: None,
795 val: 0,
796 count: 0,
797 }
798 }
799 }
800 pub struct StatBuilder<'a: 'b, 'b> {
801 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a>,
802 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
803 }
804 impl<'a: 'b, 'b> StatBuilder<'a, 'b> {
805 #[inline]
add_id(&mut self, id: flatbuffers::WIPOffset<&'b str>)806 pub fn add_id(&mut self, id: flatbuffers::WIPOffset<&'b str>) {
807 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Stat::VT_ID, id);
808 }
809 #[inline]
add_val(&mut self, val: i64)810 pub fn add_val(&mut self, val: i64) {
811 self.fbb_.push_slot::<i64>(Stat::VT_VAL, val, 0);
812 }
813 #[inline]
add_count(&mut self, count: u16)814 pub fn add_count(&mut self, count: u16) {
815 self.fbb_.push_slot::<u16>(Stat::VT_COUNT, count, 0);
816 }
817 #[inline]
new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> StatBuilder<'a, 'b>818 pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> StatBuilder<'a, 'b> {
819 let start = _fbb.start_table();
820 StatBuilder {
821 fbb_: _fbb,
822 start_: start,
823 }
824 }
825 #[inline]
finish(self) -> flatbuffers::WIPOffset<Stat<'a>>826 pub fn finish(self) -> flatbuffers::WIPOffset<Stat<'a>> {
827 let o = self.fbb_.end_table(self.start_);
828 flatbuffers::WIPOffset::new(o.value())
829 }
830 }
831
832 pub enum ReferrableOffset {}
833 #[derive(Copy, Clone, Debug, PartialEq)]
834
835 pub struct Referrable<'a> {
836 pub _tab: flatbuffers::Table<'a>,
837 }
838
839 impl<'a> flatbuffers::Follow<'a> for Referrable<'a> {
840 type Inner = Referrable<'a>;
841 #[inline]
follow(buf: &'a [u8], loc: usize) -> Self::Inner842 fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
843 Self {
844 _tab: flatbuffers::Table { buf: buf, loc: loc },
845 }
846 }
847 }
848
849 impl<'a> Referrable<'a> {
850 #[inline]
init_from_table(table: flatbuffers::Table<'a>) -> Self851 pub fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
852 Referrable {
853 _tab: table,
854 }
855 }
856 #[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>>857 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>(
858 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>,
859 args: &'args ReferrableArgs) -> flatbuffers::WIPOffset<Referrable<'bldr>> {
860 let mut builder = ReferrableBuilder::new(_fbb);
861 builder.add_id(args.id);
862 builder.finish()
863 }
864
865 pub const VT_ID: flatbuffers::VOffsetT = 4;
866
867 #[inline]
id(&self) -> u64868 pub fn id(&self) -> u64 {
869 self._tab.get::<u64>(Referrable::VT_ID, Some(0)).unwrap()
870 }
871 #[inline]
key_compare_less_than(&self, o: &Referrable) -> bool872 pub fn key_compare_less_than(&self, o: &Referrable) -> bool {
873 self.id() < o.id()
874 }
875
876 #[inline]
key_compare_with_value(&self, val: u64) -> ::std::cmp::Ordering877 pub fn key_compare_with_value(&self, val: u64) -> ::std::cmp::Ordering {
878 let key = self.id();
879 key.cmp(&val)
880 }
881 }
882
883 pub struct ReferrableArgs {
884 pub id: u64,
885 }
886 impl<'a> Default for ReferrableArgs {
887 #[inline]
default() -> Self888 fn default() -> Self {
889 ReferrableArgs {
890 id: 0,
891 }
892 }
893 }
894 pub struct ReferrableBuilder<'a: 'b, 'b> {
895 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a>,
896 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
897 }
898 impl<'a: 'b, 'b> ReferrableBuilder<'a, 'b> {
899 #[inline]
add_id(&mut self, id: u64)900 pub fn add_id(&mut self, id: u64) {
901 self.fbb_.push_slot::<u64>(Referrable::VT_ID, id, 0);
902 }
903 #[inline]
new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> ReferrableBuilder<'a, 'b>904 pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> ReferrableBuilder<'a, 'b> {
905 let start = _fbb.start_table();
906 ReferrableBuilder {
907 fbb_: _fbb,
908 start_: start,
909 }
910 }
911 #[inline]
finish(self) -> flatbuffers::WIPOffset<Referrable<'a>>912 pub fn finish(self) -> flatbuffers::WIPOffset<Referrable<'a>> {
913 let o = self.fbb_.end_table(self.start_);
914 flatbuffers::WIPOffset::new(o.value())
915 }
916 }
917
918 pub enum MonsterOffset {}
919 #[derive(Copy, Clone, Debug, PartialEq)]
920
921 /// an example documentation comment: monster object
922 pub struct Monster<'a> {
923 pub _tab: flatbuffers::Table<'a>,
924 }
925
926 impl<'a> flatbuffers::Follow<'a> for Monster<'a> {
927 type Inner = Monster<'a>;
928 #[inline]
follow(buf: &'a [u8], loc: usize) -> Self::Inner929 fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
930 Self {
931 _tab: flatbuffers::Table { buf: buf, loc: loc },
932 }
933 }
934 }
935
936 impl<'a> Monster<'a> {
937 #[inline]
init_from_table(table: flatbuffers::Table<'a>) -> Self938 pub fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
939 Monster {
940 _tab: table,
941 }
942 }
943 #[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>>944 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>(
945 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>,
946 args: &'args MonsterArgs<'args>) -> flatbuffers::WIPOffset<Monster<'bldr>> {
947 let mut builder = MonsterBuilder::new(_fbb);
948 builder.add_non_owning_reference(args.non_owning_reference);
949 builder.add_co_owning_reference(args.co_owning_reference);
950 builder.add_single_weak_reference(args.single_weak_reference);
951 builder.add_testhashu64_fnv1a(args.testhashu64_fnv1a);
952 builder.add_testhashs64_fnv1a(args.testhashs64_fnv1a);
953 builder.add_testhashu64_fnv1(args.testhashu64_fnv1);
954 builder.add_testhashs64_fnv1(args.testhashs64_fnv1);
955 if let Some(x) = args.vector_of_enums { builder.add_vector_of_enums(x); }
956 if let Some(x) = args.any_ambiguous { builder.add_any_ambiguous(x); }
957 if let Some(x) = args.any_unique { builder.add_any_unique(x); }
958 if let Some(x) = args.vector_of_non_owning_references { builder.add_vector_of_non_owning_references(x); }
959 if let Some(x) = args.vector_of_co_owning_references { builder.add_vector_of_co_owning_references(x); }
960 if let Some(x) = args.vector_of_strong_referrables { builder.add_vector_of_strong_referrables(x); }
961 if let Some(x) = args.vector_of_weak_references { builder.add_vector_of_weak_references(x); }
962 if let Some(x) = args.vector_of_referrables { builder.add_vector_of_referrables(x); }
963 if let Some(x) = args.parent_namespace_test { builder.add_parent_namespace_test(x); }
964 if let Some(x) = args.vector_of_doubles { builder.add_vector_of_doubles(x); }
965 if let Some(x) = args.vector_of_longs { builder.add_vector_of_longs(x); }
966 if let Some(x) = args.test5 { builder.add_test5(x); }
967 if let Some(x) = args.flex { builder.add_flex(x); }
968 if let Some(x) = args.testarrayofsortedstruct { builder.add_testarrayofsortedstruct(x); }
969 if let Some(x) = args.testarrayofstring2 { builder.add_testarrayofstring2(x); }
970 builder.add_testf3(args.testf3);
971 builder.add_testf2(args.testf2);
972 builder.add_testf(args.testf);
973 if let Some(x) = args.testarrayofbools { builder.add_testarrayofbools(x); }
974 builder.add_testhashu32_fnv1a(args.testhashu32_fnv1a);
975 builder.add_testhashs32_fnv1a(args.testhashs32_fnv1a);
976 builder.add_testhashu32_fnv1(args.testhashu32_fnv1);
977 builder.add_testhashs32_fnv1(args.testhashs32_fnv1);
978 if let Some(x) = args.testempty { builder.add_testempty(x); }
979 if let Some(x) = args.testnestedflatbuffer { builder.add_testnestedflatbuffer(x); }
980 if let Some(x) = args.enemy { builder.add_enemy(x); }
981 if let Some(x) = args.testarrayoftables { builder.add_testarrayoftables(x); }
982 if let Some(x) = args.testarrayofstring { builder.add_testarrayofstring(x); }
983 if let Some(x) = args.test4 { builder.add_test4(x); }
984 if let Some(x) = args.test { builder.add_test(x); }
985 if let Some(x) = args.inventory { builder.add_inventory(x); }
986 if let Some(x) = args.name { builder.add_name(x); }
987 if let Some(x) = args.pos { builder.add_pos(x); }
988 builder.add_hp(args.hp);
989 builder.add_mana(args.mana);
990 builder.add_any_ambiguous_type(args.any_ambiguous_type);
991 builder.add_any_unique_type(args.any_unique_type);
992 builder.add_testbool(args.testbool);
993 builder.add_test_type(args.test_type);
994 builder.add_color(args.color);
995 builder.finish()
996 }
997
998 pub const VT_POS: flatbuffers::VOffsetT = 4;
999 pub const VT_MANA: flatbuffers::VOffsetT = 6;
1000 pub const VT_HP: flatbuffers::VOffsetT = 8;
1001 pub const VT_NAME: flatbuffers::VOffsetT = 10;
1002 pub const VT_INVENTORY: flatbuffers::VOffsetT = 14;
1003 pub const VT_COLOR: flatbuffers::VOffsetT = 16;
1004 pub const VT_TEST_TYPE: flatbuffers::VOffsetT = 18;
1005 pub const VT_TEST: flatbuffers::VOffsetT = 20;
1006 pub const VT_TEST4: flatbuffers::VOffsetT = 22;
1007 pub const VT_TESTARRAYOFSTRING: flatbuffers::VOffsetT = 24;
1008 pub const VT_TESTARRAYOFTABLES: flatbuffers::VOffsetT = 26;
1009 pub const VT_ENEMY: flatbuffers::VOffsetT = 28;
1010 pub const VT_TESTNESTEDFLATBUFFER: flatbuffers::VOffsetT = 30;
1011 pub const VT_TESTEMPTY: flatbuffers::VOffsetT = 32;
1012 pub const VT_TESTBOOL: flatbuffers::VOffsetT = 34;
1013 pub const VT_TESTHASHS32_FNV1: flatbuffers::VOffsetT = 36;
1014 pub const VT_TESTHASHU32_FNV1: flatbuffers::VOffsetT = 38;
1015 pub const VT_TESTHASHS64_FNV1: flatbuffers::VOffsetT = 40;
1016 pub const VT_TESTHASHU64_FNV1: flatbuffers::VOffsetT = 42;
1017 pub const VT_TESTHASHS32_FNV1A: flatbuffers::VOffsetT = 44;
1018 pub const VT_TESTHASHU32_FNV1A: flatbuffers::VOffsetT = 46;
1019 pub const VT_TESTHASHS64_FNV1A: flatbuffers::VOffsetT = 48;
1020 pub const VT_TESTHASHU64_FNV1A: flatbuffers::VOffsetT = 50;
1021 pub const VT_TESTARRAYOFBOOLS: flatbuffers::VOffsetT = 52;
1022 pub const VT_TESTF: flatbuffers::VOffsetT = 54;
1023 pub const VT_TESTF2: flatbuffers::VOffsetT = 56;
1024 pub const VT_TESTF3: flatbuffers::VOffsetT = 58;
1025 pub const VT_TESTARRAYOFSTRING2: flatbuffers::VOffsetT = 60;
1026 pub const VT_TESTARRAYOFSORTEDSTRUCT: flatbuffers::VOffsetT = 62;
1027 pub const VT_FLEX: flatbuffers::VOffsetT = 64;
1028 pub const VT_TEST5: flatbuffers::VOffsetT = 66;
1029 pub const VT_VECTOR_OF_LONGS: flatbuffers::VOffsetT = 68;
1030 pub const VT_VECTOR_OF_DOUBLES: flatbuffers::VOffsetT = 70;
1031 pub const VT_PARENT_NAMESPACE_TEST: flatbuffers::VOffsetT = 72;
1032 pub const VT_VECTOR_OF_REFERRABLES: flatbuffers::VOffsetT = 74;
1033 pub const VT_SINGLE_WEAK_REFERENCE: flatbuffers::VOffsetT = 76;
1034 pub const VT_VECTOR_OF_WEAK_REFERENCES: flatbuffers::VOffsetT = 78;
1035 pub const VT_VECTOR_OF_STRONG_REFERRABLES: flatbuffers::VOffsetT = 80;
1036 pub const VT_CO_OWNING_REFERENCE: flatbuffers::VOffsetT = 82;
1037 pub const VT_VECTOR_OF_CO_OWNING_REFERENCES: flatbuffers::VOffsetT = 84;
1038 pub const VT_NON_OWNING_REFERENCE: flatbuffers::VOffsetT = 86;
1039 pub const VT_VECTOR_OF_NON_OWNING_REFERENCES: flatbuffers::VOffsetT = 88;
1040 pub const VT_ANY_UNIQUE_TYPE: flatbuffers::VOffsetT = 90;
1041 pub const VT_ANY_UNIQUE: flatbuffers::VOffsetT = 92;
1042 pub const VT_ANY_AMBIGUOUS_TYPE: flatbuffers::VOffsetT = 94;
1043 pub const VT_ANY_AMBIGUOUS: flatbuffers::VOffsetT = 96;
1044 pub const VT_VECTOR_OF_ENUMS: flatbuffers::VOffsetT = 98;
1045
1046 #[inline]
pos(&self) -> Option<&'a Vec3>1047 pub fn pos(&self) -> Option<&'a Vec3> {
1048 self._tab.get::<Vec3>(Monster::VT_POS, None)
1049 }
1050 #[inline]
mana(&self) -> i161051 pub fn mana(&self) -> i16 {
1052 self._tab.get::<i16>(Monster::VT_MANA, Some(150)).unwrap()
1053 }
1054 #[inline]
hp(&self) -> i161055 pub fn hp(&self) -> i16 {
1056 self._tab.get::<i16>(Monster::VT_HP, Some(100)).unwrap()
1057 }
1058 #[inline]
name(&self) -> &'a str1059 pub fn name(&self) -> &'a str {
1060 self._tab.get::<flatbuffers::ForwardsUOffset<&str>>(Monster::VT_NAME, None).unwrap()
1061 }
1062 #[inline]
key_compare_less_than(&self, o: &Monster) -> bool1063 pub fn key_compare_less_than(&self, o: &Monster) -> bool {
1064 self.name() < o.name()
1065 }
1066
1067 #[inline]
key_compare_with_value(&self, val: & str) -> ::std::cmp::Ordering1068 pub fn key_compare_with_value(&self, val: & str) -> ::std::cmp::Ordering {
1069 let key = self.name();
1070 key.cmp(&val)
1071 }
1072 #[inline]
inventory(&self) -> Option<&'a [u8]>1073 pub fn inventory(&self) -> Option<&'a [u8]> {
1074 self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, u8>>>(Monster::VT_INVENTORY, None).map(|v| v.safe_slice())
1075 }
1076 #[inline]
color(&self) -> Color1077 pub fn color(&self) -> Color {
1078 self._tab.get::<Color>(Monster::VT_COLOR, Some(Color::Blue)).unwrap()
1079 }
1080 #[inline]
test_type(&self) -> Any1081 pub fn test_type(&self) -> Any {
1082 self._tab.get::<Any>(Monster::VT_TEST_TYPE, Some(Any::NONE)).unwrap()
1083 }
1084 #[inline]
test(&self) -> Option<flatbuffers::Table<'a>>1085 pub fn test(&self) -> Option<flatbuffers::Table<'a>> {
1086 self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Table<'a>>>(Monster::VT_TEST, None)
1087 }
1088 #[inline]
test4(&self) -> Option<&'a [Test]>1089 pub fn test4(&self) -> Option<&'a [Test]> {
1090 self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<Test>>>(Monster::VT_TEST4, None).map(|v| v.safe_slice() )
1091 }
1092 #[inline]
testarrayofstring(&self) -> Option<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<&'a str>>>1093 pub fn testarrayofstring(&self) -> Option<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<&'a str>>> {
1094 self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<flatbuffers::ForwardsUOffset<&'a str>>>>(Monster::VT_TESTARRAYOFSTRING, None)
1095 }
1096 /// an example documentation comment: this will end up in the generated code
1097 /// multiline too
1098 #[inline]
testarrayoftables(&self) -> Option<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<Monster<'a>>>>1099 pub fn testarrayoftables(&self) -> Option<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<Monster<'a>>>> {
1100 self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<flatbuffers::ForwardsUOffset<Monster<'a>>>>>(Monster::VT_TESTARRAYOFTABLES, None)
1101 }
1102 #[inline]
enemy(&self) -> Option<Monster<'a>>1103 pub fn enemy(&self) -> Option<Monster<'a>> {
1104 self._tab.get::<flatbuffers::ForwardsUOffset<Monster<'a>>>(Monster::VT_ENEMY, None)
1105 }
1106 #[inline]
testnestedflatbuffer(&self) -> Option<&'a [u8]>1107 pub fn testnestedflatbuffer(&self) -> Option<&'a [u8]> {
1108 self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, u8>>>(Monster::VT_TESTNESTEDFLATBUFFER, None).map(|v| v.safe_slice())
1109 }
testnestedflatbuffer_nested_flatbuffer(&'a self) -> Option<Monster<'a>>1110 pub fn testnestedflatbuffer_nested_flatbuffer(&'a self) -> Option<Monster<'a>> {
1111 match self.testnestedflatbuffer() {
1112 None => { None }
1113 Some(data) => {
1114 use self::flatbuffers::Follow;
1115 Some(<flatbuffers::ForwardsUOffset<Monster<'a>>>::follow(data, 0))
1116 },
1117 }
1118 }
1119 #[inline]
testempty(&self) -> Option<Stat<'a>>1120 pub fn testempty(&self) -> Option<Stat<'a>> {
1121 self._tab.get::<flatbuffers::ForwardsUOffset<Stat<'a>>>(Monster::VT_TESTEMPTY, None)
1122 }
1123 #[inline]
testbool(&self) -> bool1124 pub fn testbool(&self) -> bool {
1125 self._tab.get::<bool>(Monster::VT_TESTBOOL, Some(false)).unwrap()
1126 }
1127 #[inline]
testhashs32_fnv1(&self) -> i321128 pub fn testhashs32_fnv1(&self) -> i32 {
1129 self._tab.get::<i32>(Monster::VT_TESTHASHS32_FNV1, Some(0)).unwrap()
1130 }
1131 #[inline]
testhashu32_fnv1(&self) -> u321132 pub fn testhashu32_fnv1(&self) -> u32 {
1133 self._tab.get::<u32>(Monster::VT_TESTHASHU32_FNV1, Some(0)).unwrap()
1134 }
1135 #[inline]
testhashs64_fnv1(&self) -> i641136 pub fn testhashs64_fnv1(&self) -> i64 {
1137 self._tab.get::<i64>(Monster::VT_TESTHASHS64_FNV1, Some(0)).unwrap()
1138 }
1139 #[inline]
testhashu64_fnv1(&self) -> u641140 pub fn testhashu64_fnv1(&self) -> u64 {
1141 self._tab.get::<u64>(Monster::VT_TESTHASHU64_FNV1, Some(0)).unwrap()
1142 }
1143 #[inline]
testhashs32_fnv1a(&self) -> i321144 pub fn testhashs32_fnv1a(&self) -> i32 {
1145 self._tab.get::<i32>(Monster::VT_TESTHASHS32_FNV1A, Some(0)).unwrap()
1146 }
1147 #[inline]
testhashu32_fnv1a(&self) -> u321148 pub fn testhashu32_fnv1a(&self) -> u32 {
1149 self._tab.get::<u32>(Monster::VT_TESTHASHU32_FNV1A, Some(0)).unwrap()
1150 }
1151 #[inline]
testhashs64_fnv1a(&self) -> i641152 pub fn testhashs64_fnv1a(&self) -> i64 {
1153 self._tab.get::<i64>(Monster::VT_TESTHASHS64_FNV1A, Some(0)).unwrap()
1154 }
1155 #[inline]
testhashu64_fnv1a(&self) -> u641156 pub fn testhashu64_fnv1a(&self) -> u64 {
1157 self._tab.get::<u64>(Monster::VT_TESTHASHU64_FNV1A, Some(0)).unwrap()
1158 }
1159 #[inline]
testarrayofbools(&self) -> Option<&'a [bool]>1160 pub fn testarrayofbools(&self) -> Option<&'a [bool]> {
1161 self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, bool>>>(Monster::VT_TESTARRAYOFBOOLS, None).map(|v| v.safe_slice())
1162 }
1163 #[inline]
testf(&self) -> f321164 pub fn testf(&self) -> f32 {
1165 self._tab.get::<f32>(Monster::VT_TESTF, Some(3.14159)).unwrap()
1166 }
1167 #[inline]
testf2(&self) -> f321168 pub fn testf2(&self) -> f32 {
1169 self._tab.get::<f32>(Monster::VT_TESTF2, Some(3.0)).unwrap()
1170 }
1171 #[inline]
testf3(&self) -> f321172 pub fn testf3(&self) -> f32 {
1173 self._tab.get::<f32>(Monster::VT_TESTF3, Some(0.0)).unwrap()
1174 }
1175 #[inline]
testarrayofstring2(&self) -> Option<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<&'a str>>>1176 pub fn testarrayofstring2(&self) -> Option<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<&'a str>>> {
1177 self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<flatbuffers::ForwardsUOffset<&'a str>>>>(Monster::VT_TESTARRAYOFSTRING2, None)
1178 }
1179 #[inline]
testarrayofsortedstruct(&self) -> Option<&'a [Ability]>1180 pub fn testarrayofsortedstruct(&self) -> Option<&'a [Ability]> {
1181 self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<Ability>>>(Monster::VT_TESTARRAYOFSORTEDSTRUCT, None).map(|v| v.safe_slice() )
1182 }
1183 #[inline]
flex(&self) -> Option<&'a [u8]>1184 pub fn flex(&self) -> Option<&'a [u8]> {
1185 self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, u8>>>(Monster::VT_FLEX, None).map(|v| v.safe_slice())
1186 }
1187 #[inline]
test5(&self) -> Option<&'a [Test]>1188 pub fn test5(&self) -> Option<&'a [Test]> {
1189 self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<Test>>>(Monster::VT_TEST5, None).map(|v| v.safe_slice() )
1190 }
1191 #[inline]
vector_of_longs(&self) -> Option<flatbuffers::Vector<'a, i64>>1192 pub fn vector_of_longs(&self) -> Option<flatbuffers::Vector<'a, i64>> {
1193 self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, i64>>>(Monster::VT_VECTOR_OF_LONGS, None)
1194 }
1195 #[inline]
vector_of_doubles(&self) -> Option<flatbuffers::Vector<'a, f64>>1196 pub fn vector_of_doubles(&self) -> Option<flatbuffers::Vector<'a, f64>> {
1197 self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, f64>>>(Monster::VT_VECTOR_OF_DOUBLES, None)
1198 }
1199 #[inline]
parent_namespace_test(&self) -> Option<super::InParentNamespace<'a>>1200 pub fn parent_namespace_test(&self) -> Option<super::InParentNamespace<'a>> {
1201 self._tab.get::<flatbuffers::ForwardsUOffset<super::InParentNamespace<'a>>>(Monster::VT_PARENT_NAMESPACE_TEST, None)
1202 }
1203 #[inline]
vector_of_referrables(&self) -> Option<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<Referrable<'a>>>>1204 pub fn vector_of_referrables(&self) -> Option<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<Referrable<'a>>>> {
1205 self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<flatbuffers::ForwardsUOffset<Referrable<'a>>>>>(Monster::VT_VECTOR_OF_REFERRABLES, None)
1206 }
1207 #[inline]
single_weak_reference(&self) -> u641208 pub fn single_weak_reference(&self) -> u64 {
1209 self._tab.get::<u64>(Monster::VT_SINGLE_WEAK_REFERENCE, Some(0)).unwrap()
1210 }
1211 #[inline]
vector_of_weak_references(&self) -> Option<flatbuffers::Vector<'a, u64>>1212 pub fn vector_of_weak_references(&self) -> Option<flatbuffers::Vector<'a, u64>> {
1213 self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, u64>>>(Monster::VT_VECTOR_OF_WEAK_REFERENCES, None)
1214 }
1215 #[inline]
vector_of_strong_referrables(&self) -> Option<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<Referrable<'a>>>>1216 pub fn vector_of_strong_referrables(&self) -> Option<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<Referrable<'a>>>> {
1217 self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<flatbuffers::ForwardsUOffset<Referrable<'a>>>>>(Monster::VT_VECTOR_OF_STRONG_REFERRABLES, None)
1218 }
1219 #[inline]
co_owning_reference(&self) -> u641220 pub fn co_owning_reference(&self) -> u64 {
1221 self._tab.get::<u64>(Monster::VT_CO_OWNING_REFERENCE, Some(0)).unwrap()
1222 }
1223 #[inline]
vector_of_co_owning_references(&self) -> Option<flatbuffers::Vector<'a, u64>>1224 pub fn vector_of_co_owning_references(&self) -> Option<flatbuffers::Vector<'a, u64>> {
1225 self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, u64>>>(Monster::VT_VECTOR_OF_CO_OWNING_REFERENCES, None)
1226 }
1227 #[inline]
non_owning_reference(&self) -> u641228 pub fn non_owning_reference(&self) -> u64 {
1229 self._tab.get::<u64>(Monster::VT_NON_OWNING_REFERENCE, Some(0)).unwrap()
1230 }
1231 #[inline]
vector_of_non_owning_references(&self) -> Option<flatbuffers::Vector<'a, u64>>1232 pub fn vector_of_non_owning_references(&self) -> Option<flatbuffers::Vector<'a, u64>> {
1233 self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, u64>>>(Monster::VT_VECTOR_OF_NON_OWNING_REFERENCES, None)
1234 }
1235 #[inline]
any_unique_type(&self) -> AnyUniqueAliases1236 pub fn any_unique_type(&self) -> AnyUniqueAliases {
1237 self._tab.get::<AnyUniqueAliases>(Monster::VT_ANY_UNIQUE_TYPE, Some(AnyUniqueAliases::NONE)).unwrap()
1238 }
1239 #[inline]
any_unique(&self) -> Option<flatbuffers::Table<'a>>1240 pub fn any_unique(&self) -> Option<flatbuffers::Table<'a>> {
1241 self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Table<'a>>>(Monster::VT_ANY_UNIQUE, None)
1242 }
1243 #[inline]
any_ambiguous_type(&self) -> AnyAmbiguousAliases1244 pub fn any_ambiguous_type(&self) -> AnyAmbiguousAliases {
1245 self._tab.get::<AnyAmbiguousAliases>(Monster::VT_ANY_AMBIGUOUS_TYPE, Some(AnyAmbiguousAliases::NONE)).unwrap()
1246 }
1247 #[inline]
any_ambiguous(&self) -> Option<flatbuffers::Table<'a>>1248 pub fn any_ambiguous(&self) -> Option<flatbuffers::Table<'a>> {
1249 self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Table<'a>>>(Monster::VT_ANY_AMBIGUOUS, None)
1250 }
1251 #[inline]
vector_of_enums(&self) -> Option<flatbuffers::Vector<'a, Color>>1252 pub fn vector_of_enums(&self) -> Option<flatbuffers::Vector<'a, Color>> {
1253 self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, Color>>>(Monster::VT_VECTOR_OF_ENUMS, None)
1254 }
1255 #[inline]
1256 #[allow(non_snake_case)]
test_as_monster(&self) -> Option<Monster<'a>>1257 pub fn test_as_monster(&self) -> Option<Monster<'a>> {
1258 if self.test_type() == Any::Monster {
1259 self.test().map(|u| Monster::init_from_table(u))
1260 } else {
1261 None
1262 }
1263 }
1264
1265 #[inline]
1266 #[allow(non_snake_case)]
test_as_test_simple_table_with_enum(&self) -> Option<TestSimpleTableWithEnum<'a>>1267 pub fn test_as_test_simple_table_with_enum(&self) -> Option<TestSimpleTableWithEnum<'a>> {
1268 if self.test_type() == Any::TestSimpleTableWithEnum {
1269 self.test().map(|u| TestSimpleTableWithEnum::init_from_table(u))
1270 } else {
1271 None
1272 }
1273 }
1274
1275 #[inline]
1276 #[allow(non_snake_case)]
test_as_my_game_example_2_monster(&self) -> Option<super::example_2::Monster<'a>>1277 pub fn test_as_my_game_example_2_monster(&self) -> Option<super::example_2::Monster<'a>> {
1278 if self.test_type() == Any::MyGame_Example2_Monster {
1279 self.test().map(|u| super::example_2::Monster::init_from_table(u))
1280 } else {
1281 None
1282 }
1283 }
1284
1285 #[inline]
1286 #[allow(non_snake_case)]
any_unique_as_m(&self) -> Option<Monster<'a>>1287 pub fn any_unique_as_m(&self) -> Option<Monster<'a>> {
1288 if self.any_unique_type() == AnyUniqueAliases::M {
1289 self.any_unique().map(|u| Monster::init_from_table(u))
1290 } else {
1291 None
1292 }
1293 }
1294
1295 #[inline]
1296 #[allow(non_snake_case)]
any_unique_as_t(&self) -> Option<TestSimpleTableWithEnum<'a>>1297 pub fn any_unique_as_t(&self) -> Option<TestSimpleTableWithEnum<'a>> {
1298 if self.any_unique_type() == AnyUniqueAliases::T {
1299 self.any_unique().map(|u| TestSimpleTableWithEnum::init_from_table(u))
1300 } else {
1301 None
1302 }
1303 }
1304
1305 #[inline]
1306 #[allow(non_snake_case)]
any_unique_as_m2(&self) -> Option<super::example_2::Monster<'a>>1307 pub fn any_unique_as_m2(&self) -> Option<super::example_2::Monster<'a>> {
1308 if self.any_unique_type() == AnyUniqueAliases::M2 {
1309 self.any_unique().map(|u| super::example_2::Monster::init_from_table(u))
1310 } else {
1311 None
1312 }
1313 }
1314
1315 #[inline]
1316 #[allow(non_snake_case)]
any_ambiguous_as_m1(&self) -> Option<Monster<'a>>1317 pub fn any_ambiguous_as_m1(&self) -> Option<Monster<'a>> {
1318 if self.any_ambiguous_type() == AnyAmbiguousAliases::M1 {
1319 self.any_ambiguous().map(|u| Monster::init_from_table(u))
1320 } else {
1321 None
1322 }
1323 }
1324
1325 #[inline]
1326 #[allow(non_snake_case)]
any_ambiguous_as_m2(&self) -> Option<Monster<'a>>1327 pub fn any_ambiguous_as_m2(&self) -> Option<Monster<'a>> {
1328 if self.any_ambiguous_type() == AnyAmbiguousAliases::M2 {
1329 self.any_ambiguous().map(|u| Monster::init_from_table(u))
1330 } else {
1331 None
1332 }
1333 }
1334
1335 #[inline]
1336 #[allow(non_snake_case)]
any_ambiguous_as_m3(&self) -> Option<Monster<'a>>1337 pub fn any_ambiguous_as_m3(&self) -> Option<Monster<'a>> {
1338 if self.any_ambiguous_type() == AnyAmbiguousAliases::M3 {
1339 self.any_ambiguous().map(|u| Monster::init_from_table(u))
1340 } else {
1341 None
1342 }
1343 }
1344
1345 }
1346
1347 pub struct MonsterArgs<'a> {
1348 pub pos: Option<&'a Vec3>,
1349 pub mana: i16,
1350 pub hp: i16,
1351 pub name: Option<flatbuffers::WIPOffset<&'a str>>,
1352 pub inventory: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a , u8>>>,
1353 pub color: Color,
1354 pub test_type: Any,
1355 pub test: Option<flatbuffers::WIPOffset<flatbuffers::UnionWIPOffset>>,
1356 pub test4: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a , Test>>>,
1357 pub testarrayofstring: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a , flatbuffers::ForwardsUOffset<&'a str>>>>,
1358 pub testarrayoftables: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a , flatbuffers::ForwardsUOffset<Monster<'a >>>>>,
1359 pub enemy: Option<flatbuffers::WIPOffset<Monster<'a >>>,
1360 pub testnestedflatbuffer: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a , u8>>>,
1361 pub testempty: Option<flatbuffers::WIPOffset<Stat<'a >>>,
1362 pub testbool: bool,
1363 pub testhashs32_fnv1: i32,
1364 pub testhashu32_fnv1: u32,
1365 pub testhashs64_fnv1: i64,
1366 pub testhashu64_fnv1: u64,
1367 pub testhashs32_fnv1a: i32,
1368 pub testhashu32_fnv1a: u32,
1369 pub testhashs64_fnv1a: i64,
1370 pub testhashu64_fnv1a: u64,
1371 pub testarrayofbools: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a , bool>>>,
1372 pub testf: f32,
1373 pub testf2: f32,
1374 pub testf3: f32,
1375 pub testarrayofstring2: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a , flatbuffers::ForwardsUOffset<&'a str>>>>,
1376 pub testarrayofsortedstruct: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a , Ability>>>,
1377 pub flex: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a , u8>>>,
1378 pub test5: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a , Test>>>,
1379 pub vector_of_longs: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a , i64>>>,
1380 pub vector_of_doubles: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a , f64>>>,
1381 pub parent_namespace_test: Option<flatbuffers::WIPOffset<super::InParentNamespace<'a >>>,
1382 pub vector_of_referrables: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a , flatbuffers::ForwardsUOffset<Referrable<'a >>>>>,
1383 pub single_weak_reference: u64,
1384 pub vector_of_weak_references: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a , u64>>>,
1385 pub vector_of_strong_referrables: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a , flatbuffers::ForwardsUOffset<Referrable<'a >>>>>,
1386 pub co_owning_reference: u64,
1387 pub vector_of_co_owning_references: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a , u64>>>,
1388 pub non_owning_reference: u64,
1389 pub vector_of_non_owning_references: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a , u64>>>,
1390 pub any_unique_type: AnyUniqueAliases,
1391 pub any_unique: Option<flatbuffers::WIPOffset<flatbuffers::UnionWIPOffset>>,
1392 pub any_ambiguous_type: AnyAmbiguousAliases,
1393 pub any_ambiguous: Option<flatbuffers::WIPOffset<flatbuffers::UnionWIPOffset>>,
1394 pub vector_of_enums: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a , Color>>>,
1395 }
1396 impl<'a> Default for MonsterArgs<'a> {
1397 #[inline]
default() -> Self1398 fn default() -> Self {
1399 MonsterArgs {
1400 pos: None,
1401 mana: 150,
1402 hp: 100,
1403 name: None, // required field
1404 inventory: None,
1405 color: Color::Blue,
1406 test_type: Any::NONE,
1407 test: None,
1408 test4: None,
1409 testarrayofstring: None,
1410 testarrayoftables: None,
1411 enemy: None,
1412 testnestedflatbuffer: None,
1413 testempty: None,
1414 testbool: false,
1415 testhashs32_fnv1: 0,
1416 testhashu32_fnv1: 0,
1417 testhashs64_fnv1: 0,
1418 testhashu64_fnv1: 0,
1419 testhashs32_fnv1a: 0,
1420 testhashu32_fnv1a: 0,
1421 testhashs64_fnv1a: 0,
1422 testhashu64_fnv1a: 0,
1423 testarrayofbools: None,
1424 testf: 3.14159,
1425 testf2: 3.0,
1426 testf3: 0.0,
1427 testarrayofstring2: None,
1428 testarrayofsortedstruct: None,
1429 flex: None,
1430 test5: None,
1431 vector_of_longs: None,
1432 vector_of_doubles: None,
1433 parent_namespace_test: None,
1434 vector_of_referrables: None,
1435 single_weak_reference: 0,
1436 vector_of_weak_references: None,
1437 vector_of_strong_referrables: None,
1438 co_owning_reference: 0,
1439 vector_of_co_owning_references: None,
1440 non_owning_reference: 0,
1441 vector_of_non_owning_references: None,
1442 any_unique_type: AnyUniqueAliases::NONE,
1443 any_unique: None,
1444 any_ambiguous_type: AnyAmbiguousAliases::NONE,
1445 any_ambiguous: None,
1446 vector_of_enums: None,
1447 }
1448 }
1449 }
1450 pub struct MonsterBuilder<'a: 'b, 'b> {
1451 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a>,
1452 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
1453 }
1454 impl<'a: 'b, 'b> MonsterBuilder<'a, 'b> {
1455 #[inline]
add_pos(&mut self, pos: &'b Vec3)1456 pub fn add_pos(&mut self, pos: &'b Vec3) {
1457 self.fbb_.push_slot_always::<&Vec3>(Monster::VT_POS, pos);
1458 }
1459 #[inline]
add_mana(&mut self, mana: i16)1460 pub fn add_mana(&mut self, mana: i16) {
1461 self.fbb_.push_slot::<i16>(Monster::VT_MANA, mana, 150);
1462 }
1463 #[inline]
add_hp(&mut self, hp: i16)1464 pub fn add_hp(&mut self, hp: i16) {
1465 self.fbb_.push_slot::<i16>(Monster::VT_HP, hp, 100);
1466 }
1467 #[inline]
add_name(&mut self, name: flatbuffers::WIPOffset<&'b str>)1468 pub fn add_name(&mut self, name: flatbuffers::WIPOffset<&'b str>) {
1469 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Monster::VT_NAME, name);
1470 }
1471 #[inline]
add_inventory(&mut self, inventory: flatbuffers::WIPOffset<flatbuffers::Vector<'b , u8>>)1472 pub fn add_inventory(&mut self, inventory: flatbuffers::WIPOffset<flatbuffers::Vector<'b , u8>>) {
1473 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Monster::VT_INVENTORY, inventory);
1474 }
1475 #[inline]
add_color(&mut self, color: Color)1476 pub fn add_color(&mut self, color: Color) {
1477 self.fbb_.push_slot::<Color>(Monster::VT_COLOR, color, Color::Blue);
1478 }
1479 #[inline]
add_test_type(&mut self, test_type: Any)1480 pub fn add_test_type(&mut self, test_type: Any) {
1481 self.fbb_.push_slot::<Any>(Monster::VT_TEST_TYPE, test_type, Any::NONE);
1482 }
1483 #[inline]
add_test(&mut self, test: flatbuffers::WIPOffset<flatbuffers::UnionWIPOffset>)1484 pub fn add_test(&mut self, test: flatbuffers::WIPOffset<flatbuffers::UnionWIPOffset>) {
1485 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Monster::VT_TEST, test);
1486 }
1487 #[inline]
add_test4(&mut self, test4: flatbuffers::WIPOffset<flatbuffers::Vector<'b , Test>>)1488 pub fn add_test4(&mut self, test4: flatbuffers::WIPOffset<flatbuffers::Vector<'b , Test>>) {
1489 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Monster::VT_TEST4, test4);
1490 }
1491 #[inline]
add_testarrayofstring(&mut self, testarrayofstring: flatbuffers::WIPOffset<flatbuffers::Vector<'b , flatbuffers::ForwardsUOffset<&'b str>>>)1492 pub fn add_testarrayofstring(&mut self, testarrayofstring: flatbuffers::WIPOffset<flatbuffers::Vector<'b , flatbuffers::ForwardsUOffset<&'b str>>>) {
1493 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Monster::VT_TESTARRAYOFSTRING, testarrayofstring);
1494 }
1495 #[inline]
add_testarrayoftables(&mut self, testarrayoftables: flatbuffers::WIPOffset<flatbuffers::Vector<'b , flatbuffers::ForwardsUOffset<Monster<'b >>>>)1496 pub fn add_testarrayoftables(&mut self, testarrayoftables: flatbuffers::WIPOffset<flatbuffers::Vector<'b , flatbuffers::ForwardsUOffset<Monster<'b >>>>) {
1497 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Monster::VT_TESTARRAYOFTABLES, testarrayoftables);
1498 }
1499 #[inline]
add_enemy(&mut self, enemy: flatbuffers::WIPOffset<Monster<'b >>)1500 pub fn add_enemy(&mut self, enemy: flatbuffers::WIPOffset<Monster<'b >>) {
1501 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<Monster>>(Monster::VT_ENEMY, enemy);
1502 }
1503 #[inline]
add_testnestedflatbuffer(&mut self, testnestedflatbuffer: flatbuffers::WIPOffset<flatbuffers::Vector<'b , u8>>)1504 pub fn add_testnestedflatbuffer(&mut self, testnestedflatbuffer: flatbuffers::WIPOffset<flatbuffers::Vector<'b , u8>>) {
1505 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Monster::VT_TESTNESTEDFLATBUFFER, testnestedflatbuffer);
1506 }
1507 #[inline]
add_testempty(&mut self, testempty: flatbuffers::WIPOffset<Stat<'b >>)1508 pub fn add_testempty(&mut self, testempty: flatbuffers::WIPOffset<Stat<'b >>) {
1509 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<Stat>>(Monster::VT_TESTEMPTY, testempty);
1510 }
1511 #[inline]
add_testbool(&mut self, testbool: bool)1512 pub fn add_testbool(&mut self, testbool: bool) {
1513 self.fbb_.push_slot::<bool>(Monster::VT_TESTBOOL, testbool, false);
1514 }
1515 #[inline]
add_testhashs32_fnv1(&mut self, testhashs32_fnv1: i32)1516 pub fn add_testhashs32_fnv1(&mut self, testhashs32_fnv1: i32) {
1517 self.fbb_.push_slot::<i32>(Monster::VT_TESTHASHS32_FNV1, testhashs32_fnv1, 0);
1518 }
1519 #[inline]
add_testhashu32_fnv1(&mut self, testhashu32_fnv1: u32)1520 pub fn add_testhashu32_fnv1(&mut self, testhashu32_fnv1: u32) {
1521 self.fbb_.push_slot::<u32>(Monster::VT_TESTHASHU32_FNV1, testhashu32_fnv1, 0);
1522 }
1523 #[inline]
add_testhashs64_fnv1(&mut self, testhashs64_fnv1: i64)1524 pub fn add_testhashs64_fnv1(&mut self, testhashs64_fnv1: i64) {
1525 self.fbb_.push_slot::<i64>(Monster::VT_TESTHASHS64_FNV1, testhashs64_fnv1, 0);
1526 }
1527 #[inline]
add_testhashu64_fnv1(&mut self, testhashu64_fnv1: u64)1528 pub fn add_testhashu64_fnv1(&mut self, testhashu64_fnv1: u64) {
1529 self.fbb_.push_slot::<u64>(Monster::VT_TESTHASHU64_FNV1, testhashu64_fnv1, 0);
1530 }
1531 #[inline]
add_testhashs32_fnv1a(&mut self, testhashs32_fnv1a: i32)1532 pub fn add_testhashs32_fnv1a(&mut self, testhashs32_fnv1a: i32) {
1533 self.fbb_.push_slot::<i32>(Monster::VT_TESTHASHS32_FNV1A, testhashs32_fnv1a, 0);
1534 }
1535 #[inline]
add_testhashu32_fnv1a(&mut self, testhashu32_fnv1a: u32)1536 pub fn add_testhashu32_fnv1a(&mut self, testhashu32_fnv1a: u32) {
1537 self.fbb_.push_slot::<u32>(Monster::VT_TESTHASHU32_FNV1A, testhashu32_fnv1a, 0);
1538 }
1539 #[inline]
add_testhashs64_fnv1a(&mut self, testhashs64_fnv1a: i64)1540 pub fn add_testhashs64_fnv1a(&mut self, testhashs64_fnv1a: i64) {
1541 self.fbb_.push_slot::<i64>(Monster::VT_TESTHASHS64_FNV1A, testhashs64_fnv1a, 0);
1542 }
1543 #[inline]
add_testhashu64_fnv1a(&mut self, testhashu64_fnv1a: u64)1544 pub fn add_testhashu64_fnv1a(&mut self, testhashu64_fnv1a: u64) {
1545 self.fbb_.push_slot::<u64>(Monster::VT_TESTHASHU64_FNV1A, testhashu64_fnv1a, 0);
1546 }
1547 #[inline]
add_testarrayofbools(&mut self, testarrayofbools: flatbuffers::WIPOffset<flatbuffers::Vector<'b , bool>>)1548 pub fn add_testarrayofbools(&mut self, testarrayofbools: flatbuffers::WIPOffset<flatbuffers::Vector<'b , bool>>) {
1549 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Monster::VT_TESTARRAYOFBOOLS, testarrayofbools);
1550 }
1551 #[inline]
add_testf(&mut self, testf: f32)1552 pub fn add_testf(&mut self, testf: f32) {
1553 self.fbb_.push_slot::<f32>(Monster::VT_TESTF, testf, 3.14159);
1554 }
1555 #[inline]
add_testf2(&mut self, testf2: f32)1556 pub fn add_testf2(&mut self, testf2: f32) {
1557 self.fbb_.push_slot::<f32>(Monster::VT_TESTF2, testf2, 3.0);
1558 }
1559 #[inline]
add_testf3(&mut self, testf3: f32)1560 pub fn add_testf3(&mut self, testf3: f32) {
1561 self.fbb_.push_slot::<f32>(Monster::VT_TESTF3, testf3, 0.0);
1562 }
1563 #[inline]
add_testarrayofstring2(&mut self, testarrayofstring2: flatbuffers::WIPOffset<flatbuffers::Vector<'b , flatbuffers::ForwardsUOffset<&'b str>>>)1564 pub fn add_testarrayofstring2(&mut self, testarrayofstring2: flatbuffers::WIPOffset<flatbuffers::Vector<'b , flatbuffers::ForwardsUOffset<&'b str>>>) {
1565 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Monster::VT_TESTARRAYOFSTRING2, testarrayofstring2);
1566 }
1567 #[inline]
add_testarrayofsortedstruct(&mut self, testarrayofsortedstruct: flatbuffers::WIPOffset<flatbuffers::Vector<'b , Ability>>)1568 pub fn add_testarrayofsortedstruct(&mut self, testarrayofsortedstruct: flatbuffers::WIPOffset<flatbuffers::Vector<'b , Ability>>) {
1569 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Monster::VT_TESTARRAYOFSORTEDSTRUCT, testarrayofsortedstruct);
1570 }
1571 #[inline]
add_flex(&mut self, flex: flatbuffers::WIPOffset<flatbuffers::Vector<'b , u8>>)1572 pub fn add_flex(&mut self, flex: flatbuffers::WIPOffset<flatbuffers::Vector<'b , u8>>) {
1573 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Monster::VT_FLEX, flex);
1574 }
1575 #[inline]
add_test5(&mut self, test5: flatbuffers::WIPOffset<flatbuffers::Vector<'b , Test>>)1576 pub fn add_test5(&mut self, test5: flatbuffers::WIPOffset<flatbuffers::Vector<'b , Test>>) {
1577 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Monster::VT_TEST5, test5);
1578 }
1579 #[inline]
add_vector_of_longs(&mut self, vector_of_longs: flatbuffers::WIPOffset<flatbuffers::Vector<'b , i64>>)1580 pub fn add_vector_of_longs(&mut self, vector_of_longs: flatbuffers::WIPOffset<flatbuffers::Vector<'b , i64>>) {
1581 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Monster::VT_VECTOR_OF_LONGS, vector_of_longs);
1582 }
1583 #[inline]
add_vector_of_doubles(&mut self, vector_of_doubles: flatbuffers::WIPOffset<flatbuffers::Vector<'b , f64>>)1584 pub fn add_vector_of_doubles(&mut self, vector_of_doubles: flatbuffers::WIPOffset<flatbuffers::Vector<'b , f64>>) {
1585 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Monster::VT_VECTOR_OF_DOUBLES, vector_of_doubles);
1586 }
1587 #[inline]
add_parent_namespace_test(&mut self, parent_namespace_test: flatbuffers::WIPOffset<super::InParentNamespace<'b >>)1588 pub fn add_parent_namespace_test(&mut self, parent_namespace_test: flatbuffers::WIPOffset<super::InParentNamespace<'b >>) {
1589 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<super::InParentNamespace>>(Monster::VT_PARENT_NAMESPACE_TEST, parent_namespace_test);
1590 }
1591 #[inline]
add_vector_of_referrables(&mut self, vector_of_referrables: flatbuffers::WIPOffset<flatbuffers::Vector<'b , flatbuffers::ForwardsUOffset<Referrable<'b >>>>)1592 pub fn add_vector_of_referrables(&mut self, vector_of_referrables: flatbuffers::WIPOffset<flatbuffers::Vector<'b , flatbuffers::ForwardsUOffset<Referrable<'b >>>>) {
1593 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Monster::VT_VECTOR_OF_REFERRABLES, vector_of_referrables);
1594 }
1595 #[inline]
add_single_weak_reference(&mut self, single_weak_reference: u64)1596 pub fn add_single_weak_reference(&mut self, single_weak_reference: u64) {
1597 self.fbb_.push_slot::<u64>(Monster::VT_SINGLE_WEAK_REFERENCE, single_weak_reference, 0);
1598 }
1599 #[inline]
add_vector_of_weak_references(&mut self, vector_of_weak_references: flatbuffers::WIPOffset<flatbuffers::Vector<'b , u64>>)1600 pub fn add_vector_of_weak_references(&mut self, vector_of_weak_references: flatbuffers::WIPOffset<flatbuffers::Vector<'b , u64>>) {
1601 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Monster::VT_VECTOR_OF_WEAK_REFERENCES, vector_of_weak_references);
1602 }
1603 #[inline]
add_vector_of_strong_referrables(&mut self, vector_of_strong_referrables: flatbuffers::WIPOffset<flatbuffers::Vector<'b , flatbuffers::ForwardsUOffset<Referrable<'b >>>>)1604 pub fn add_vector_of_strong_referrables(&mut self, vector_of_strong_referrables: flatbuffers::WIPOffset<flatbuffers::Vector<'b , flatbuffers::ForwardsUOffset<Referrable<'b >>>>) {
1605 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Monster::VT_VECTOR_OF_STRONG_REFERRABLES, vector_of_strong_referrables);
1606 }
1607 #[inline]
add_co_owning_reference(&mut self, co_owning_reference: u64)1608 pub fn add_co_owning_reference(&mut self, co_owning_reference: u64) {
1609 self.fbb_.push_slot::<u64>(Monster::VT_CO_OWNING_REFERENCE, co_owning_reference, 0);
1610 }
1611 #[inline]
add_vector_of_co_owning_references(&mut self, vector_of_co_owning_references: flatbuffers::WIPOffset<flatbuffers::Vector<'b , u64>>)1612 pub fn add_vector_of_co_owning_references(&mut self, vector_of_co_owning_references: flatbuffers::WIPOffset<flatbuffers::Vector<'b , u64>>) {
1613 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Monster::VT_VECTOR_OF_CO_OWNING_REFERENCES, vector_of_co_owning_references);
1614 }
1615 #[inline]
add_non_owning_reference(&mut self, non_owning_reference: u64)1616 pub fn add_non_owning_reference(&mut self, non_owning_reference: u64) {
1617 self.fbb_.push_slot::<u64>(Monster::VT_NON_OWNING_REFERENCE, non_owning_reference, 0);
1618 }
1619 #[inline]
add_vector_of_non_owning_references(&mut self, vector_of_non_owning_references: flatbuffers::WIPOffset<flatbuffers::Vector<'b , u64>>)1620 pub fn add_vector_of_non_owning_references(&mut self, vector_of_non_owning_references: flatbuffers::WIPOffset<flatbuffers::Vector<'b , u64>>) {
1621 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Monster::VT_VECTOR_OF_NON_OWNING_REFERENCES, vector_of_non_owning_references);
1622 }
1623 #[inline]
add_any_unique_type(&mut self, any_unique_type: AnyUniqueAliases)1624 pub fn add_any_unique_type(&mut self, any_unique_type: AnyUniqueAliases) {
1625 self.fbb_.push_slot::<AnyUniqueAliases>(Monster::VT_ANY_UNIQUE_TYPE, any_unique_type, AnyUniqueAliases::NONE);
1626 }
1627 #[inline]
add_any_unique(&mut self, any_unique: flatbuffers::WIPOffset<flatbuffers::UnionWIPOffset>)1628 pub fn add_any_unique(&mut self, any_unique: flatbuffers::WIPOffset<flatbuffers::UnionWIPOffset>) {
1629 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Monster::VT_ANY_UNIQUE, any_unique);
1630 }
1631 #[inline]
add_any_ambiguous_type(&mut self, any_ambiguous_type: AnyAmbiguousAliases)1632 pub fn add_any_ambiguous_type(&mut self, any_ambiguous_type: AnyAmbiguousAliases) {
1633 self.fbb_.push_slot::<AnyAmbiguousAliases>(Monster::VT_ANY_AMBIGUOUS_TYPE, any_ambiguous_type, AnyAmbiguousAliases::NONE);
1634 }
1635 #[inline]
add_any_ambiguous(&mut self, any_ambiguous: flatbuffers::WIPOffset<flatbuffers::UnionWIPOffset>)1636 pub fn add_any_ambiguous(&mut self, any_ambiguous: flatbuffers::WIPOffset<flatbuffers::UnionWIPOffset>) {
1637 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Monster::VT_ANY_AMBIGUOUS, any_ambiguous);
1638 }
1639 #[inline]
add_vector_of_enums(&mut self, vector_of_enums: flatbuffers::WIPOffset<flatbuffers::Vector<'b , Color>>)1640 pub fn add_vector_of_enums(&mut self, vector_of_enums: flatbuffers::WIPOffset<flatbuffers::Vector<'b , Color>>) {
1641 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Monster::VT_VECTOR_OF_ENUMS, vector_of_enums);
1642 }
1643 #[inline]
new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> MonsterBuilder<'a, 'b>1644 pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> MonsterBuilder<'a, 'b> {
1645 let start = _fbb.start_table();
1646 MonsterBuilder {
1647 fbb_: _fbb,
1648 start_: start,
1649 }
1650 }
1651 #[inline]
finish(self) -> flatbuffers::WIPOffset<Monster<'a>>1652 pub fn finish(self) -> flatbuffers::WIPOffset<Monster<'a>> {
1653 let o = self.fbb_.end_table(self.start_);
1654 self.fbb_.required(o, Monster::VT_NAME,"name");
1655 flatbuffers::WIPOffset::new(o.value())
1656 }
1657 }
1658
1659 pub enum TypeAliasesOffset {}
1660 #[derive(Copy, Clone, Debug, PartialEq)]
1661
1662 pub struct TypeAliases<'a> {
1663 pub _tab: flatbuffers::Table<'a>,
1664 }
1665
1666 impl<'a> flatbuffers::Follow<'a> for TypeAliases<'a> {
1667 type Inner = TypeAliases<'a>;
1668 #[inline]
follow(buf: &'a [u8], loc: usize) -> Self::Inner1669 fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
1670 Self {
1671 _tab: flatbuffers::Table { buf: buf, loc: loc },
1672 }
1673 }
1674 }
1675
1676 impl<'a> TypeAliases<'a> {
1677 #[inline]
init_from_table(table: flatbuffers::Table<'a>) -> Self1678 pub fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
1679 TypeAliases {
1680 _tab: table,
1681 }
1682 }
1683 #[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>>1684 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>(
1685 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>,
1686 args: &'args TypeAliasesArgs<'args>) -> flatbuffers::WIPOffset<TypeAliases<'bldr>> {
1687 let mut builder = TypeAliasesBuilder::new(_fbb);
1688 builder.add_f64_(args.f64_);
1689 builder.add_u64_(args.u64_);
1690 builder.add_i64_(args.i64_);
1691 if let Some(x) = args.vf64 { builder.add_vf64(x); }
1692 if let Some(x) = args.v8 { builder.add_v8(x); }
1693 builder.add_f32_(args.f32_);
1694 builder.add_u32_(args.u32_);
1695 builder.add_i32_(args.i32_);
1696 builder.add_u16_(args.u16_);
1697 builder.add_i16_(args.i16_);
1698 builder.add_u8_(args.u8_);
1699 builder.add_i8_(args.i8_);
1700 builder.finish()
1701 }
1702
1703 pub const VT_I8_: flatbuffers::VOffsetT = 4;
1704 pub const VT_U8_: flatbuffers::VOffsetT = 6;
1705 pub const VT_I16_: flatbuffers::VOffsetT = 8;
1706 pub const VT_U16_: flatbuffers::VOffsetT = 10;
1707 pub const VT_I32_: flatbuffers::VOffsetT = 12;
1708 pub const VT_U32_: flatbuffers::VOffsetT = 14;
1709 pub const VT_I64_: flatbuffers::VOffsetT = 16;
1710 pub const VT_U64_: flatbuffers::VOffsetT = 18;
1711 pub const VT_F32_: flatbuffers::VOffsetT = 20;
1712 pub const VT_F64_: flatbuffers::VOffsetT = 22;
1713 pub const VT_V8: flatbuffers::VOffsetT = 24;
1714 pub const VT_VF64: flatbuffers::VOffsetT = 26;
1715
1716 #[inline]
i8_(&self) -> i81717 pub fn i8_(&self) -> i8 {
1718 self._tab.get::<i8>(TypeAliases::VT_I8_, Some(0)).unwrap()
1719 }
1720 #[inline]
u8_(&self) -> u81721 pub fn u8_(&self) -> u8 {
1722 self._tab.get::<u8>(TypeAliases::VT_U8_, Some(0)).unwrap()
1723 }
1724 #[inline]
i16_(&self) -> i161725 pub fn i16_(&self) -> i16 {
1726 self._tab.get::<i16>(TypeAliases::VT_I16_, Some(0)).unwrap()
1727 }
1728 #[inline]
u16_(&self) -> u161729 pub fn u16_(&self) -> u16 {
1730 self._tab.get::<u16>(TypeAliases::VT_U16_, Some(0)).unwrap()
1731 }
1732 #[inline]
i32_(&self) -> i321733 pub fn i32_(&self) -> i32 {
1734 self._tab.get::<i32>(TypeAliases::VT_I32_, Some(0)).unwrap()
1735 }
1736 #[inline]
u32_(&self) -> u321737 pub fn u32_(&self) -> u32 {
1738 self._tab.get::<u32>(TypeAliases::VT_U32_, Some(0)).unwrap()
1739 }
1740 #[inline]
i64_(&self) -> i641741 pub fn i64_(&self) -> i64 {
1742 self._tab.get::<i64>(TypeAliases::VT_I64_, Some(0)).unwrap()
1743 }
1744 #[inline]
u64_(&self) -> u641745 pub fn u64_(&self) -> u64 {
1746 self._tab.get::<u64>(TypeAliases::VT_U64_, Some(0)).unwrap()
1747 }
1748 #[inline]
f32_(&self) -> f321749 pub fn f32_(&self) -> f32 {
1750 self._tab.get::<f32>(TypeAliases::VT_F32_, Some(0.0)).unwrap()
1751 }
1752 #[inline]
f64_(&self) -> f641753 pub fn f64_(&self) -> f64 {
1754 self._tab.get::<f64>(TypeAliases::VT_F64_, Some(0.0)).unwrap()
1755 }
1756 #[inline]
v8(&self) -> Option<&'a [i8]>1757 pub fn v8(&self) -> Option<&'a [i8]> {
1758 self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, i8>>>(TypeAliases::VT_V8, None).map(|v| v.safe_slice())
1759 }
1760 #[inline]
vf64(&self) -> Option<flatbuffers::Vector<'a, f64>>1761 pub fn vf64(&self) -> Option<flatbuffers::Vector<'a, f64>> {
1762 self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, f64>>>(TypeAliases::VT_VF64, None)
1763 }
1764 }
1765
1766 pub struct TypeAliasesArgs<'a> {
1767 pub i8_: i8,
1768 pub u8_: u8,
1769 pub i16_: i16,
1770 pub u16_: u16,
1771 pub i32_: i32,
1772 pub u32_: u32,
1773 pub i64_: i64,
1774 pub u64_: u64,
1775 pub f32_: f32,
1776 pub f64_: f64,
1777 pub v8: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a , i8>>>,
1778 pub vf64: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a , f64>>>,
1779 }
1780 impl<'a> Default for TypeAliasesArgs<'a> {
1781 #[inline]
default() -> Self1782 fn default() -> Self {
1783 TypeAliasesArgs {
1784 i8_: 0,
1785 u8_: 0,
1786 i16_: 0,
1787 u16_: 0,
1788 i32_: 0,
1789 u32_: 0,
1790 i64_: 0,
1791 u64_: 0,
1792 f32_: 0.0,
1793 f64_: 0.0,
1794 v8: None,
1795 vf64: None,
1796 }
1797 }
1798 }
1799 pub struct TypeAliasesBuilder<'a: 'b, 'b> {
1800 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a>,
1801 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
1802 }
1803 impl<'a: 'b, 'b> TypeAliasesBuilder<'a, 'b> {
1804 #[inline]
add_i8_(&mut self, i8_: i8)1805 pub fn add_i8_(&mut self, i8_: i8) {
1806 self.fbb_.push_slot::<i8>(TypeAliases::VT_I8_, i8_, 0);
1807 }
1808 #[inline]
add_u8_(&mut self, u8_: u8)1809 pub fn add_u8_(&mut self, u8_: u8) {
1810 self.fbb_.push_slot::<u8>(TypeAliases::VT_U8_, u8_, 0);
1811 }
1812 #[inline]
add_i16_(&mut self, i16_: i16)1813 pub fn add_i16_(&mut self, i16_: i16) {
1814 self.fbb_.push_slot::<i16>(TypeAliases::VT_I16_, i16_, 0);
1815 }
1816 #[inline]
add_u16_(&mut self, u16_: u16)1817 pub fn add_u16_(&mut self, u16_: u16) {
1818 self.fbb_.push_slot::<u16>(TypeAliases::VT_U16_, u16_, 0);
1819 }
1820 #[inline]
add_i32_(&mut self, i32_: i32)1821 pub fn add_i32_(&mut self, i32_: i32) {
1822 self.fbb_.push_slot::<i32>(TypeAliases::VT_I32_, i32_, 0);
1823 }
1824 #[inline]
add_u32_(&mut self, u32_: u32)1825 pub fn add_u32_(&mut self, u32_: u32) {
1826 self.fbb_.push_slot::<u32>(TypeAliases::VT_U32_, u32_, 0);
1827 }
1828 #[inline]
add_i64_(&mut self, i64_: i64)1829 pub fn add_i64_(&mut self, i64_: i64) {
1830 self.fbb_.push_slot::<i64>(TypeAliases::VT_I64_, i64_, 0);
1831 }
1832 #[inline]
add_u64_(&mut self, u64_: u64)1833 pub fn add_u64_(&mut self, u64_: u64) {
1834 self.fbb_.push_slot::<u64>(TypeAliases::VT_U64_, u64_, 0);
1835 }
1836 #[inline]
add_f32_(&mut self, f32_: f32)1837 pub fn add_f32_(&mut self, f32_: f32) {
1838 self.fbb_.push_slot::<f32>(TypeAliases::VT_F32_, f32_, 0.0);
1839 }
1840 #[inline]
add_f64_(&mut self, f64_: f64)1841 pub fn add_f64_(&mut self, f64_: f64) {
1842 self.fbb_.push_slot::<f64>(TypeAliases::VT_F64_, f64_, 0.0);
1843 }
1844 #[inline]
add_v8(&mut self, v8: flatbuffers::WIPOffset<flatbuffers::Vector<'b , i8>>)1845 pub fn add_v8(&mut self, v8: flatbuffers::WIPOffset<flatbuffers::Vector<'b , i8>>) {
1846 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(TypeAliases::VT_V8, v8);
1847 }
1848 #[inline]
add_vf64(&mut self, vf64: flatbuffers::WIPOffset<flatbuffers::Vector<'b , f64>>)1849 pub fn add_vf64(&mut self, vf64: flatbuffers::WIPOffset<flatbuffers::Vector<'b , f64>>) {
1850 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(TypeAliases::VT_VF64, vf64);
1851 }
1852 #[inline]
new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> TypeAliasesBuilder<'a, 'b>1853 pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> TypeAliasesBuilder<'a, 'b> {
1854 let start = _fbb.start_table();
1855 TypeAliasesBuilder {
1856 fbb_: _fbb,
1857 start_: start,
1858 }
1859 }
1860 #[inline]
finish(self) -> flatbuffers::WIPOffset<TypeAliases<'a>>1861 pub fn finish(self) -> flatbuffers::WIPOffset<TypeAliases<'a>> {
1862 let o = self.fbb_.end_table(self.start_);
1863 flatbuffers::WIPOffset::new(o.value())
1864 }
1865 }
1866
1867 #[inline]
get_root_as_monster<'a>(buf: &'a [u8]) -> Monster<'a>1868 pub fn get_root_as_monster<'a>(buf: &'a [u8]) -> Monster<'a> {
1869 flatbuffers::get_root::<Monster<'a>>(buf)
1870 }
1871
1872 #[inline]
get_size_prefixed_root_as_monster<'a>(buf: &'a [u8]) -> Monster<'a>1873 pub fn get_size_prefixed_root_as_monster<'a>(buf: &'a [u8]) -> Monster<'a> {
1874 flatbuffers::get_size_prefixed_root::<Monster<'a>>(buf)
1875 }
1876
1877 pub const MONSTER_IDENTIFIER: &'static str = "MONS";
1878
1879 #[inline]
monster_buffer_has_identifier(buf: &[u8]) -> bool1880 pub fn monster_buffer_has_identifier(buf: &[u8]) -> bool {
1881 return flatbuffers::buffer_has_identifier(buf, MONSTER_IDENTIFIER, false);
1882 }
1883
1884 #[inline]
monster_size_prefixed_buffer_has_identifier(buf: &[u8]) -> bool1885 pub fn monster_size_prefixed_buffer_has_identifier(buf: &[u8]) -> bool {
1886 return flatbuffers::buffer_has_identifier(buf, MONSTER_IDENTIFIER, true);
1887 }
1888
1889 pub const MONSTER_EXTENSION: &'static str = "mon";
1890
1891 #[inline]
finish_monster_buffer<'a, 'b>( fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>, root: flatbuffers::WIPOffset<Monster<'a>>)1892 pub fn finish_monster_buffer<'a, 'b>(
1893 fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>,
1894 root: flatbuffers::WIPOffset<Monster<'a>>) {
1895 fbb.finish(root, Some(MONSTER_IDENTIFIER));
1896 }
1897
1898 #[inline]
finish_size_prefixed_monster_buffer<'a, 'b>(fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>, root: flatbuffers::WIPOffset<Monster<'a>>)1899 pub fn finish_size_prefixed_monster_buffer<'a, 'b>(fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>, root: flatbuffers::WIPOffset<Monster<'a>>) {
1900 fbb.finish_size_prefixed(root, Some(MONSTER_IDENTIFIER));
1901 }
1902 } // pub mod Example
1903 } // pub mod MyGame
1904
1905