1 // automatically generated by the FlatBuffers compiler, do not modify
2
3
4
5 use crate::include_test1_generated::*;
6 use std::mem;
7 use std::cmp::Ordering;
8
9 extern crate flatbuffers;
10 use self::flatbuffers::EndianScalar;
11
12 #[allow(unused_imports, dead_code)]
13 pub mod my_game {
14
15 use crate::include_test1_generated::*;
16 use std::mem;
17 use std::cmp::Ordering;
18
19 extern crate flatbuffers;
20 use self::flatbuffers::EndianScalar;
21 #[allow(unused_imports, dead_code)]
22 pub mod other_name_space {
23
24 use crate::include_test1_generated::*;
25 use std::mem;
26 use std::cmp::Ordering;
27
28 extern crate flatbuffers;
29 use self::flatbuffers::EndianScalar;
30
31 #[allow(non_camel_case_types)]
32 #[repr(i64)]
33 #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)]
34 pub enum FromInclude {
35 IncludeVal = 0,
36
37 }
38
39 pub const ENUM_MIN_FROM_INCLUDE: i64 = 0;
40 pub const ENUM_MAX_FROM_INCLUDE: i64 = 0;
41
42 impl<'a> flatbuffers::Follow<'a> for FromInclude {
43 type Inner = Self;
44 #[inline]
follow(buf: &'a [u8], loc: usize) -> Self::Inner45 fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
46 flatbuffers::read_scalar_at::<Self>(buf, loc)
47 }
48 }
49
50 impl flatbuffers::EndianScalar for FromInclude {
51 #[inline]
to_little_endian(self) -> Self52 fn to_little_endian(self) -> Self {
53 let n = i64::to_le(self as i64);
54 let p = &n as *const i64 as *const FromInclude;
55 unsafe { *p }
56 }
57 #[inline]
from_little_endian(self) -> Self58 fn from_little_endian(self) -> Self {
59 let n = i64::from_le(self as i64);
60 let p = &n as *const i64 as *const FromInclude;
61 unsafe { *p }
62 }
63 }
64
65 impl flatbuffers::Push for FromInclude {
66 type Output = FromInclude;
67 #[inline]
push(&self, dst: &mut [u8], _rest: &[u8])68 fn push(&self, dst: &mut [u8], _rest: &[u8]) {
69 flatbuffers::emplace_scalar::<FromInclude>(dst, *self);
70 }
71 }
72
73 #[allow(non_camel_case_types)]
74 pub const ENUM_VALUES_FROM_INCLUDE:[FromInclude; 1] = [
75 FromInclude::IncludeVal
76 ];
77
78 #[allow(non_camel_case_types)]
79 pub const ENUM_NAMES_FROM_INCLUDE:[&'static str; 1] = [
80 "IncludeVal"
81 ];
82
enum_name_from_include(e: FromInclude) -> &'static str83 pub fn enum_name_from_include(e: FromInclude) -> &'static str {
84 let index = e as i64;
85 ENUM_NAMES_FROM_INCLUDE[index as usize]
86 }
87
88 // struct Unused, aligned to 4
89 #[repr(C, align(4))]
90 #[derive(Clone, Copy, Debug, PartialEq)]
91 pub struct Unused {
92 a_: i32,
93 } // pub struct Unused
94 impl flatbuffers::SafeSliceAccess for Unused {}
95 impl<'a> flatbuffers::Follow<'a> for Unused {
96 type Inner = &'a Unused;
97 #[inline]
follow(buf: &'a [u8], loc: usize) -> Self::Inner98 fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
99 <&'a Unused>::follow(buf, loc)
100 }
101 }
102 impl<'a> flatbuffers::Follow<'a> for &'a Unused {
103 type Inner = &'a Unused;
104 #[inline]
follow(buf: &'a [u8], loc: usize) -> Self::Inner105 fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
106 flatbuffers::follow_cast_ref::<Unused>(buf, loc)
107 }
108 }
109 impl<'b> flatbuffers::Push for Unused {
110 type Output = Unused;
111 #[inline]
push(&self, dst: &mut [u8], _rest: &[u8])112 fn push(&self, dst: &mut [u8], _rest: &[u8]) {
113 let src = unsafe {
114 ::std::slice::from_raw_parts(self as *const Unused as *const u8, Self::size())
115 };
116 dst.copy_from_slice(src);
117 }
118 }
119 impl<'b> flatbuffers::Push for &'b Unused {
120 type Output = Unused;
121
122 #[inline]
push(&self, dst: &mut [u8], _rest: &[u8])123 fn push(&self, dst: &mut [u8], _rest: &[u8]) {
124 let src = unsafe {
125 ::std::slice::from_raw_parts(*self as *const Unused as *const u8, Self::size())
126 };
127 dst.copy_from_slice(src);
128 }
129 }
130
131
132 impl Unused {
new<'a>(_a: i32) -> Self133 pub fn new<'a>(_a: i32) -> Self {
134 Unused {
135 a_: _a.to_little_endian(),
136
137 }
138 }
a<'a>(&'a self) -> i32139 pub fn a<'a>(&'a self) -> i32 {
140 self.a_.from_little_endian()
141 }
142 }
143
144 pub enum TableBOffset {}
145 #[derive(Copy, Clone, Debug, PartialEq)]
146
147 pub struct TableB<'a> {
148 pub _tab: flatbuffers::Table<'a>,
149 }
150
151 impl<'a> flatbuffers::Follow<'a> for TableB<'a> {
152 type Inner = TableB<'a>;
153 #[inline]
follow(buf: &'a [u8], loc: usize) -> Self::Inner154 fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
155 Self {
156 _tab: flatbuffers::Table { buf: buf, loc: loc },
157 }
158 }
159 }
160
161 impl<'a> TableB<'a> {
162 #[inline]
init_from_table(table: flatbuffers::Table<'a>) -> Self163 pub fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
164 TableB {
165 _tab: table,
166 }
167 }
168 #[allow(unused_mut)]
create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>( _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>, args: &'args TableBArgs<'args>) -> flatbuffers::WIPOffset<TableB<'bldr>>169 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>(
170 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>,
171 args: &'args TableBArgs<'args>) -> flatbuffers::WIPOffset<TableB<'bldr>> {
172 let mut builder = TableBBuilder::new(_fbb);
173 if let Some(x) = args.a { builder.add_a(x); }
174 builder.finish()
175 }
176
177 pub const VT_A: flatbuffers::VOffsetT = 4;
178
179 #[inline]
a(&self) -> Option<super::super::TableA<'a>>180 pub fn a(&self) -> Option<super::super::TableA<'a>> {
181 self._tab.get::<flatbuffers::ForwardsUOffset<super::super::TableA<'a>>>(TableB::VT_A, None)
182 }
183 }
184
185 pub struct TableBArgs<'a> {
186 pub a: Option<flatbuffers::WIPOffset<super::super::TableA<'a >>>,
187 }
188 impl<'a> Default for TableBArgs<'a> {
189 #[inline]
default() -> Self190 fn default() -> Self {
191 TableBArgs {
192 a: None,
193 }
194 }
195 }
196 pub struct TableBBuilder<'a: 'b, 'b> {
197 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a>,
198 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
199 }
200 impl<'a: 'b, 'b> TableBBuilder<'a, 'b> {
201 #[inline]
add_a(&mut self, a: flatbuffers::WIPOffset<super::super::TableA<'b >>)202 pub fn add_a(&mut self, a: flatbuffers::WIPOffset<super::super::TableA<'b >>) {
203 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<super::super::TableA>>(TableB::VT_A, a);
204 }
205 #[inline]
new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> TableBBuilder<'a, 'b>206 pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> TableBBuilder<'a, 'b> {
207 let start = _fbb.start_table();
208 TableBBuilder {
209 fbb_: _fbb,
210 start_: start,
211 }
212 }
213 #[inline]
finish(self) -> flatbuffers::WIPOffset<TableB<'a>>214 pub fn finish(self) -> flatbuffers::WIPOffset<TableB<'a>> {
215 let o = self.fbb_.end_table(self.start_);
216 flatbuffers::WIPOffset::new(o.value())
217 }
218 }
219
220 } // pub mod OtherNameSpace
221 } // pub mod MyGame
222
223