1 // automatically generated by the FlatBuffers compiler, do not modify
2 // @generated
3 extern crate alloc;
4 extern crate flatbuffers;
5 use alloc::boxed::Box;
6 use alloc::string::{String, ToString};
7 use alloc::vec::Vec;
8 use core::mem;
9 use core::cmp::Ordering;
10 use self::flatbuffers::{EndianScalar, Follow};
11 use super::*;
12 pub enum ArrayTableOffset {}
13 #[derive(Copy, Clone, PartialEq)]
14
15 pub struct ArrayTable<'a> {
16 pub _tab: flatbuffers::Table<'a>,
17 }
18
19 impl<'a> flatbuffers::Follow<'a> for ArrayTable<'a> {
20 type Inner = ArrayTable<'a>;
21 #[inline]
follow(buf: &'a [u8], loc: usize) -> Self::Inner22 fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
23 Self { _tab: flatbuffers::Table { buf, loc } }
24 }
25 }
26
27 impl<'a> ArrayTable<'a> {
28 pub const VT_A: flatbuffers::VOffsetT = 4;
29
get_fully_qualified_name() -> &'static str30 pub const fn get_fully_qualified_name() -> &'static str {
31 "MyGame.Example.ArrayTable"
32 }
33
34 #[inline]
init_from_table(table: flatbuffers::Table<'a>) -> Self35 pub fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
36 ArrayTable { _tab: table }
37 }
38 #[allow(unused_mut)]
create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>( _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>, args: &'args ArrayTableArgs<'args> ) -> flatbuffers::WIPOffset<ArrayTable<'bldr>>39 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>(
40 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>,
41 args: &'args ArrayTableArgs<'args>
42 ) -> flatbuffers::WIPOffset<ArrayTable<'bldr>> {
43 let mut builder = ArrayTableBuilder::new(_fbb);
44 if let Some(x) = args.a { builder.add_a(x); }
45 builder.finish()
46 }
47
unpack(&self) -> ArrayTableT48 pub fn unpack(&self) -> ArrayTableT {
49 let a = self.a().map(|x| {
50 x.unpack()
51 });
52 ArrayTableT {
53 a,
54 }
55 }
56
57 #[inline]
a(&self) -> Option<&'a ArrayStruct>58 pub fn a(&self) -> Option<&'a ArrayStruct> {
59 self._tab.get::<ArrayStruct>(ArrayTable::VT_A, None)
60 }
61 }
62
63 impl flatbuffers::Verifiable for ArrayTable<'_> {
64 #[inline]
run_verifier( v: &mut flatbuffers::Verifier, pos: usize ) -> Result<(), flatbuffers::InvalidFlatbuffer>65 fn run_verifier(
66 v: &mut flatbuffers::Verifier, pos: usize
67 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
68 use self::flatbuffers::Verifiable;
69 v.visit_table(pos)?
70 .visit_field::<ArrayStruct>("a", Self::VT_A, false)?
71 .finish();
72 Ok(())
73 }
74 }
75 pub struct ArrayTableArgs<'a> {
76 pub a: Option<&'a ArrayStruct>,
77 }
78 impl<'a> Default for ArrayTableArgs<'a> {
79 #[inline]
default() -> Self80 fn default() -> Self {
81 ArrayTableArgs {
82 a: None,
83 }
84 }
85 }
86
87 pub struct ArrayTableBuilder<'a: 'b, 'b> {
88 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a>,
89 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
90 }
91 impl<'a: 'b, 'b> ArrayTableBuilder<'a, 'b> {
92 #[inline]
add_a(&mut self, a: &ArrayStruct)93 pub fn add_a(&mut self, a: &ArrayStruct) {
94 self.fbb_.push_slot_always::<&ArrayStruct>(ArrayTable::VT_A, a);
95 }
96 #[inline]
new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> ArrayTableBuilder<'a, 'b>97 pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> ArrayTableBuilder<'a, 'b> {
98 let start = _fbb.start_table();
99 ArrayTableBuilder {
100 fbb_: _fbb,
101 start_: start,
102 }
103 }
104 #[inline]
finish(self) -> flatbuffers::WIPOffset<ArrayTable<'a>>105 pub fn finish(self) -> flatbuffers::WIPOffset<ArrayTable<'a>> {
106 let o = self.fbb_.end_table(self.start_);
107 flatbuffers::WIPOffset::new(o.value())
108 }
109 }
110
111 impl core::fmt::Debug for ArrayTable<'_> {
fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result112 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
113 let mut ds = f.debug_struct("ArrayTable");
114 ds.field("a", &self.a());
115 ds.finish()
116 }
117 }
118 #[non_exhaustive]
119 #[derive(Debug, Clone, PartialEq)]
120 pub struct ArrayTableT {
121 pub a: Option<ArrayStructT>,
122 }
123 impl Default for ArrayTableT {
default() -> Self124 fn default() -> Self {
125 Self {
126 a: None,
127 }
128 }
129 }
130 impl ArrayTableT {
pack<'b>( &self, _fbb: &mut flatbuffers::FlatBufferBuilder<'b> ) -> flatbuffers::WIPOffset<ArrayTable<'b>>131 pub fn pack<'b>(
132 &self,
133 _fbb: &mut flatbuffers::FlatBufferBuilder<'b>
134 ) -> flatbuffers::WIPOffset<ArrayTable<'b>> {
135 let a_tmp = self.a.as_ref().map(|x| x.pack());
136 let a = a_tmp.as_ref();
137 ArrayTable::create(_fbb, &ArrayTableArgs{
138 a,
139 })
140 }
141 }
142 #[inline]
143 #[deprecated(since="2.0.0", note="Deprecated in favor of `root_as...` methods.")]
get_root_as_array_table<'a>(buf: &'a [u8]) -> ArrayTable<'a>144 pub fn get_root_as_array_table<'a>(buf: &'a [u8]) -> ArrayTable<'a> {
145 unsafe { flatbuffers::root_unchecked::<ArrayTable<'a>>(buf) }
146 }
147
148 #[inline]
149 #[deprecated(since="2.0.0", note="Deprecated in favor of `root_as...` methods.")]
get_size_prefixed_root_as_array_table<'a>(buf: &'a [u8]) -> ArrayTable<'a>150 pub fn get_size_prefixed_root_as_array_table<'a>(buf: &'a [u8]) -> ArrayTable<'a> {
151 unsafe { flatbuffers::size_prefixed_root_unchecked::<ArrayTable<'a>>(buf) }
152 }
153
154 #[inline]
155 /// Verifies that a buffer of bytes contains a `ArrayTable`
156 /// and returns it.
157 /// Note that verification is still experimental and may not
158 /// catch every error, or be maximally performant. For the
159 /// previous, unchecked, behavior use
160 /// `root_as_array_table_unchecked`.
root_as_array_table(buf: &[u8]) -> Result<ArrayTable, flatbuffers::InvalidFlatbuffer>161 pub fn root_as_array_table(buf: &[u8]) -> Result<ArrayTable, flatbuffers::InvalidFlatbuffer> {
162 flatbuffers::root::<ArrayTable>(buf)
163 }
164 #[inline]
165 /// Verifies that a buffer of bytes contains a size prefixed
166 /// `ArrayTable` and returns it.
167 /// Note that verification is still experimental and may not
168 /// catch every error, or be maximally performant. For the
169 /// previous, unchecked, behavior use
170 /// `size_prefixed_root_as_array_table_unchecked`.
size_prefixed_root_as_array_table(buf: &[u8]) -> Result<ArrayTable, flatbuffers::InvalidFlatbuffer>171 pub fn size_prefixed_root_as_array_table(buf: &[u8]) -> Result<ArrayTable, flatbuffers::InvalidFlatbuffer> {
172 flatbuffers::size_prefixed_root::<ArrayTable>(buf)
173 }
174 #[inline]
175 /// Verifies, with the given options, that a buffer of bytes
176 /// contains a `ArrayTable` and returns it.
177 /// Note that verification is still experimental and may not
178 /// catch every error, or be maximally performant. For the
179 /// previous, unchecked, behavior use
180 /// `root_as_array_table_unchecked`.
root_as_array_table_with_opts<'b, 'o>( opts: &'o flatbuffers::VerifierOptions, buf: &'b [u8], ) -> Result<ArrayTable<'b>, flatbuffers::InvalidFlatbuffer>181 pub fn root_as_array_table_with_opts<'b, 'o>(
182 opts: &'o flatbuffers::VerifierOptions,
183 buf: &'b [u8],
184 ) -> Result<ArrayTable<'b>, flatbuffers::InvalidFlatbuffer> {
185 flatbuffers::root_with_opts::<ArrayTable<'b>>(opts, buf)
186 }
187 #[inline]
188 /// Verifies, with the given verifier options, that a buffer of
189 /// bytes contains a size prefixed `ArrayTable` and returns
190 /// it. Note that verification is still experimental and may not
191 /// catch every error, or be maximally performant. For the
192 /// previous, unchecked, behavior use
193 /// `root_as_array_table_unchecked`.
size_prefixed_root_as_array_table_with_opts<'b, 'o>( opts: &'o flatbuffers::VerifierOptions, buf: &'b [u8], ) -> Result<ArrayTable<'b>, flatbuffers::InvalidFlatbuffer>194 pub fn size_prefixed_root_as_array_table_with_opts<'b, 'o>(
195 opts: &'o flatbuffers::VerifierOptions,
196 buf: &'b [u8],
197 ) -> Result<ArrayTable<'b>, flatbuffers::InvalidFlatbuffer> {
198 flatbuffers::size_prefixed_root_with_opts::<ArrayTable<'b>>(opts, buf)
199 }
200 #[inline]
201 /// Assumes, without verification, that a buffer of bytes contains a ArrayTable and returns it.
202 /// # Safety
203 /// Callers must trust the given bytes do indeed contain a valid `ArrayTable`.
root_as_array_table_unchecked(buf: &[u8]) -> ArrayTable204 pub unsafe fn root_as_array_table_unchecked(buf: &[u8]) -> ArrayTable {
205 flatbuffers::root_unchecked::<ArrayTable>(buf)
206 }
207 #[inline]
208 /// Assumes, without verification, that a buffer of bytes contains a size prefixed ArrayTable and returns it.
209 /// # Safety
210 /// Callers must trust the given bytes do indeed contain a valid size prefixed `ArrayTable`.
size_prefixed_root_as_array_table_unchecked(buf: &[u8]) -> ArrayTable211 pub unsafe fn size_prefixed_root_as_array_table_unchecked(buf: &[u8]) -> ArrayTable {
212 flatbuffers::size_prefixed_root_unchecked::<ArrayTable>(buf)
213 }
214 pub const ARRAY_TABLE_IDENTIFIER: &str = "ARRT";
215
216 #[inline]
array_table_buffer_has_identifier(buf: &[u8]) -> bool217 pub fn array_table_buffer_has_identifier(buf: &[u8]) -> bool {
218 flatbuffers::buffer_has_identifier(buf, ARRAY_TABLE_IDENTIFIER, false)
219 }
220
221 #[inline]
array_table_size_prefixed_buffer_has_identifier(buf: &[u8]) -> bool222 pub fn array_table_size_prefixed_buffer_has_identifier(buf: &[u8]) -> bool {
223 flatbuffers::buffer_has_identifier(buf, ARRAY_TABLE_IDENTIFIER, true)
224 }
225
226 pub const ARRAY_TABLE_EXTENSION: &str = "mon";
227
228 #[inline]
finish_array_table_buffer<'a, 'b>( fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>, root: flatbuffers::WIPOffset<ArrayTable<'a>>)229 pub fn finish_array_table_buffer<'a, 'b>(
230 fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>,
231 root: flatbuffers::WIPOffset<ArrayTable<'a>>) {
232 fbb.finish(root, Some(ARRAY_TABLE_IDENTIFIER));
233 }
234
235 #[inline]
finish_size_prefixed_array_table_buffer<'a, 'b>(fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>, root: flatbuffers::WIPOffset<ArrayTable<'a>>)236 pub fn finish_size_prefixed_array_table_buffer<'a, 'b>(fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>, root: flatbuffers::WIPOffset<ArrayTable<'a>>) {
237 fbb.finish_size_prefixed(root, Some(ARRAY_TABLE_IDENTIFIER));
238 }
239