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, Follow}; 10 11 #[allow(unused_imports, dead_code)] 12 pub mod namespace_a { 13 14 use std::mem; 15 use std::cmp::Ordering; 16 17 extern crate flatbuffers; 18 use self::flatbuffers::{EndianScalar, Follow}; 19 #[allow(unused_imports, dead_code)] 20 pub mod namespace_b { 21 22 use std::mem; 23 use std::cmp::Ordering; 24 25 extern crate flatbuffers; 26 use self::flatbuffers::{EndianScalar, Follow}; 27 28 #[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")] 29 pub const ENUM_MIN_UNION_IN_NESTED_NS: u8 = 0; 30 #[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")] 31 pub const ENUM_MAX_UNION_IN_NESTED_NS: u8 = 1; 32 #[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")] 33 #[allow(non_camel_case_types)] 34 pub const ENUM_VALUES_UNION_IN_NESTED_NS: [UnionInNestedNS; 2] = [ 35 UnionInNestedNS::NONE, 36 UnionInNestedNS::TableInNestedNS, 37 ]; 38 39 #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)] 40 #[repr(transparent)] 41 pub struct UnionInNestedNS(pub u8); 42 #[allow(non_upper_case_globals)] 43 impl UnionInNestedNS { 44 pub const NONE: Self = Self(0); 45 pub const TableInNestedNS: Self = Self(1); 46 47 pub const ENUM_MIN: u8 = 0; 48 pub const ENUM_MAX: u8 = 1; 49 pub const ENUM_VALUES: &'static [Self] = &[ 50 Self::NONE, 51 Self::TableInNestedNS, 52 ]; 53 /// Returns the variant's name or "" if unknown. variant_name(self) -> Option<&'static str>54 pub fn variant_name(self) -> Option<&'static str> { 55 match self { 56 Self::NONE => Some("NONE"), 57 Self::TableInNestedNS => Some("TableInNestedNS"), 58 _ => None, 59 } 60 } 61 } 62 impl std::fmt::Debug for UnionInNestedNS { fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result63 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { 64 if let Some(name) = self.variant_name() { 65 f.write_str(name) 66 } else { 67 f.write_fmt(format_args!("<UNKNOWN {:?}>", self.0)) 68 } 69 } 70 } 71 impl<'a> flatbuffers::Follow<'a> for UnionInNestedNS { 72 type Inner = Self; 73 #[inline] follow(buf: &'a [u8], loc: usize) -> Self::Inner74 fn follow(buf: &'a [u8], loc: usize) -> Self::Inner { 75 let b = unsafe { 76 flatbuffers::read_scalar_at::<u8>(buf, loc) 77 }; 78 Self(b) 79 } 80 } 81 82 impl flatbuffers::Push for UnionInNestedNS { 83 type Output = UnionInNestedNS; 84 #[inline] push(&self, dst: &mut [u8], _rest: &[u8])85 fn push(&self, dst: &mut [u8], _rest: &[u8]) { 86 unsafe { flatbuffers::emplace_scalar::<u8>(dst, self.0); } 87 } 88 } 89 90 impl flatbuffers::EndianScalar for UnionInNestedNS { 91 #[inline] to_little_endian(self) -> Self92 fn to_little_endian(self) -> Self { 93 let b = u8::to_le(self.0); 94 Self(b) 95 } 96 #[inline] 97 #[allow(clippy::wrong_self_convention)] from_little_endian(self) -> Self98 fn from_little_endian(self) -> Self { 99 let b = u8::from_le(self.0); 100 Self(b) 101 } 102 } 103 104 impl<'a> flatbuffers::Verifiable for UnionInNestedNS { 105 #[inline] run_verifier( v: &mut flatbuffers::Verifier, pos: usize ) -> Result<(), flatbuffers::InvalidFlatbuffer>106 fn run_verifier( 107 v: &mut flatbuffers::Verifier, pos: usize 108 ) -> Result<(), flatbuffers::InvalidFlatbuffer> { 109 use self::flatbuffers::Verifiable; 110 u8::run_verifier(v, pos) 111 } 112 } 113 114 impl flatbuffers::SimpleToVerifyInSlice for UnionInNestedNS {} 115 pub struct UnionInNestedNSUnionTableOffset {} 116 117 #[non_exhaustive] 118 #[derive(Debug, Clone, PartialEq)] 119 pub enum UnionInNestedNST { 120 NONE, 121 TableInNestedNS(Box<TableInNestedNST>), 122 } 123 impl Default for UnionInNestedNST { default() -> Self124 fn default() -> Self { 125 Self::NONE 126 } 127 } 128 impl UnionInNestedNST { union_in_nested_ns_type(&self) -> UnionInNestedNS129 pub fn union_in_nested_ns_type(&self) -> UnionInNestedNS { 130 match self { 131 Self::NONE => UnionInNestedNS::NONE, 132 Self::TableInNestedNS(_) => UnionInNestedNS::TableInNestedNS, 133 } 134 } pack(&self, fbb: &mut flatbuffers::FlatBufferBuilder) -> Option<flatbuffers::WIPOffset<flatbuffers::UnionWIPOffset>>135 pub fn pack(&self, fbb: &mut flatbuffers::FlatBufferBuilder) -> Option<flatbuffers::WIPOffset<flatbuffers::UnionWIPOffset>> { 136 match self { 137 Self::NONE => None, 138 Self::TableInNestedNS(v) => Some(v.pack(fbb).as_union_value()), 139 } 140 } 141 /// If the union variant matches, return the owned TableInNestedNST, setting the union to NONE. take_table_in_nested_ns(&mut self) -> Option<Box<TableInNestedNST>>142 pub fn take_table_in_nested_ns(&mut self) -> Option<Box<TableInNestedNST>> { 143 if let Self::TableInNestedNS(_) = self { 144 let v = std::mem::replace(self, Self::NONE); 145 if let Self::TableInNestedNS(w) = v { 146 Some(w) 147 } else { 148 unreachable!() 149 } 150 } else { 151 None 152 } 153 } 154 /// If the union variant matches, return a reference to the TableInNestedNST. as_table_in_nested_ns(&self) -> Option<&TableInNestedNST>155 pub fn as_table_in_nested_ns(&self) -> Option<&TableInNestedNST> { 156 if let Self::TableInNestedNS(v) = self { Some(v.as_ref()) } else { None } 157 } 158 /// If the union variant matches, return a mutable reference to the TableInNestedNST. as_table_in_nested_ns_mut(&mut self) -> Option<&mut TableInNestedNST>159 pub fn as_table_in_nested_ns_mut(&mut self) -> Option<&mut TableInNestedNST> { 160 if let Self::TableInNestedNS(v) = self { Some(v.as_mut()) } else { None } 161 } 162 } 163 #[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")] 164 pub const ENUM_MIN_ENUM_IN_NESTED_NS: i8 = 0; 165 #[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")] 166 pub const ENUM_MAX_ENUM_IN_NESTED_NS: i8 = 2; 167 #[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")] 168 #[allow(non_camel_case_types)] 169 pub const ENUM_VALUES_ENUM_IN_NESTED_NS: [EnumInNestedNS; 3] = [ 170 EnumInNestedNS::A, 171 EnumInNestedNS::B, 172 EnumInNestedNS::C, 173 ]; 174 175 #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)] 176 #[repr(transparent)] 177 pub struct EnumInNestedNS(pub i8); 178 #[allow(non_upper_case_globals)] 179 impl EnumInNestedNS { 180 pub const A: Self = Self(0); 181 pub const B: Self = Self(1); 182 pub const C: Self = Self(2); 183 184 pub const ENUM_MIN: i8 = 0; 185 pub const ENUM_MAX: i8 = 2; 186 pub const ENUM_VALUES: &'static [Self] = &[ 187 Self::A, 188 Self::B, 189 Self::C, 190 ]; 191 /// Returns the variant's name or "" if unknown. variant_name(self) -> Option<&'static str>192 pub fn variant_name(self) -> Option<&'static str> { 193 match self { 194 Self::A => Some("A"), 195 Self::B => Some("B"), 196 Self::C => Some("C"), 197 _ => None, 198 } 199 } 200 } 201 impl std::fmt::Debug for EnumInNestedNS { fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result202 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { 203 if let Some(name) = self.variant_name() { 204 f.write_str(name) 205 } else { 206 f.write_fmt(format_args!("<UNKNOWN {:?}>", self.0)) 207 } 208 } 209 } 210 impl<'a> flatbuffers::Follow<'a> for EnumInNestedNS { 211 type Inner = Self; 212 #[inline] follow(buf: &'a [u8], loc: usize) -> Self::Inner213 fn follow(buf: &'a [u8], loc: usize) -> Self::Inner { 214 let b = unsafe { 215 flatbuffers::read_scalar_at::<i8>(buf, loc) 216 }; 217 Self(b) 218 } 219 } 220 221 impl flatbuffers::Push for EnumInNestedNS { 222 type Output = EnumInNestedNS; 223 #[inline] push(&self, dst: &mut [u8], _rest: &[u8])224 fn push(&self, dst: &mut [u8], _rest: &[u8]) { 225 unsafe { flatbuffers::emplace_scalar::<i8>(dst, self.0); } 226 } 227 } 228 229 impl flatbuffers::EndianScalar for EnumInNestedNS { 230 #[inline] to_little_endian(self) -> Self231 fn to_little_endian(self) -> Self { 232 let b = i8::to_le(self.0); 233 Self(b) 234 } 235 #[inline] 236 #[allow(clippy::wrong_self_convention)] from_little_endian(self) -> Self237 fn from_little_endian(self) -> Self { 238 let b = i8::from_le(self.0); 239 Self(b) 240 } 241 } 242 243 impl<'a> flatbuffers::Verifiable for EnumInNestedNS { 244 #[inline] run_verifier( v: &mut flatbuffers::Verifier, pos: usize ) -> Result<(), flatbuffers::InvalidFlatbuffer>245 fn run_verifier( 246 v: &mut flatbuffers::Verifier, pos: usize 247 ) -> Result<(), flatbuffers::InvalidFlatbuffer> { 248 use self::flatbuffers::Verifiable; 249 i8::run_verifier(v, pos) 250 } 251 } 252 253 impl flatbuffers::SimpleToVerifyInSlice for EnumInNestedNS {} 254 // struct StructInNestedNS, aligned to 4 255 #[repr(transparent)] 256 #[derive(Clone, Copy, PartialEq)] 257 pub struct StructInNestedNS(pub [u8; 8]); 258 impl Default for StructInNestedNS { default() -> Self259 fn default() -> Self { 260 Self([0; 8]) 261 } 262 } 263 impl std::fmt::Debug for StructInNestedNS { fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result264 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { 265 f.debug_struct("StructInNestedNS") 266 .field("a", &self.a()) 267 .field("b", &self.b()) 268 .finish() 269 } 270 } 271 272 impl flatbuffers::SimpleToVerifyInSlice for StructInNestedNS {} 273 impl flatbuffers::SafeSliceAccess for StructInNestedNS {} 274 impl<'a> flatbuffers::Follow<'a> for StructInNestedNS { 275 type Inner = &'a StructInNestedNS; 276 #[inline] follow(buf: &'a [u8], loc: usize) -> Self::Inner277 fn follow(buf: &'a [u8], loc: usize) -> Self::Inner { 278 <&'a StructInNestedNS>::follow(buf, loc) 279 } 280 } 281 impl<'a> flatbuffers::Follow<'a> for &'a StructInNestedNS { 282 type Inner = &'a StructInNestedNS; 283 #[inline] follow(buf: &'a [u8], loc: usize) -> Self::Inner284 fn follow(buf: &'a [u8], loc: usize) -> Self::Inner { 285 flatbuffers::follow_cast_ref::<StructInNestedNS>(buf, loc) 286 } 287 } 288 impl<'b> flatbuffers::Push for StructInNestedNS { 289 type Output = StructInNestedNS; 290 #[inline] push(&self, dst: &mut [u8], _rest: &[u8])291 fn push(&self, dst: &mut [u8], _rest: &[u8]) { 292 let src = unsafe { 293 ::std::slice::from_raw_parts(self as *const StructInNestedNS as *const u8, Self::size()) 294 }; 295 dst.copy_from_slice(src); 296 } 297 } 298 impl<'b> flatbuffers::Push for &'b StructInNestedNS { 299 type Output = StructInNestedNS; 300 301 #[inline] push(&self, dst: &mut [u8], _rest: &[u8])302 fn push(&self, dst: &mut [u8], _rest: &[u8]) { 303 let src = unsafe { 304 ::std::slice::from_raw_parts(*self as *const StructInNestedNS as *const u8, Self::size()) 305 }; 306 dst.copy_from_slice(src); 307 } 308 } 309 310 impl<'a> flatbuffers::Verifiable for StructInNestedNS { 311 #[inline] run_verifier( v: &mut flatbuffers::Verifier, pos: usize ) -> Result<(), flatbuffers::InvalidFlatbuffer>312 fn run_verifier( 313 v: &mut flatbuffers::Verifier, pos: usize 314 ) -> Result<(), flatbuffers::InvalidFlatbuffer> { 315 use self::flatbuffers::Verifiable; 316 v.in_buffer::<Self>(pos) 317 } 318 } 319 impl<'a> StructInNestedNS { 320 #[allow(clippy::too_many_arguments)] new( a: i32, b: i32, ) -> Self321 pub fn new( 322 a: i32, 323 b: i32, 324 ) -> Self { 325 let mut s = Self([0; 8]); 326 s.set_a(a); 327 s.set_b(b); 328 s 329 } 330 get_fully_qualified_name() -> &'static str331 pub const fn get_fully_qualified_name() -> &'static str { 332 "NamespaceA.NamespaceB.StructInNestedNS" 333 } 334 a(&self) -> i32335 pub fn a(&self) -> i32 { 336 let mut mem = core::mem::MaybeUninit::<i32>::uninit(); 337 unsafe { 338 core::ptr::copy_nonoverlapping( 339 self.0[0..].as_ptr(), 340 mem.as_mut_ptr() as *mut u8, 341 core::mem::size_of::<i32>(), 342 ); 343 mem.assume_init() 344 }.from_little_endian() 345 } 346 set_a(&mut self, x: i32)347 pub fn set_a(&mut self, x: i32) { 348 let x_le = x.to_little_endian(); 349 unsafe { 350 core::ptr::copy_nonoverlapping( 351 &x_le as *const i32 as *const u8, 352 self.0[0..].as_mut_ptr(), 353 core::mem::size_of::<i32>(), 354 ); 355 } 356 } 357 b(&self) -> i32358 pub fn b(&self) -> i32 { 359 let mut mem = core::mem::MaybeUninit::<i32>::uninit(); 360 unsafe { 361 core::ptr::copy_nonoverlapping( 362 self.0[4..].as_ptr(), 363 mem.as_mut_ptr() as *mut u8, 364 core::mem::size_of::<i32>(), 365 ); 366 mem.assume_init() 367 }.from_little_endian() 368 } 369 set_b(&mut self, x: i32)370 pub fn set_b(&mut self, x: i32) { 371 let x_le = x.to_little_endian(); 372 unsafe { 373 core::ptr::copy_nonoverlapping( 374 &x_le as *const i32 as *const u8, 375 self.0[4..].as_mut_ptr(), 376 core::mem::size_of::<i32>(), 377 ); 378 } 379 } 380 unpack(&self) -> StructInNestedNST381 pub fn unpack(&self) -> StructInNestedNST { 382 StructInNestedNST { 383 a: self.a(), 384 b: self.b(), 385 } 386 } 387 } 388 389 #[derive(Debug, Clone, PartialEq, Default)] 390 pub struct StructInNestedNST { 391 pub a: i32, 392 pub b: i32, 393 } 394 impl StructInNestedNST { pack(&self) -> StructInNestedNS395 pub fn pack(&self) -> StructInNestedNS { 396 StructInNestedNS::new( 397 self.a, 398 self.b, 399 ) 400 } 401 } 402 403 pub enum TableInNestedNSOffset {} 404 #[derive(Copy, Clone, PartialEq)] 405 406 pub struct TableInNestedNS<'a> { 407 pub _tab: flatbuffers::Table<'a>, 408 } 409 410 impl<'a> flatbuffers::Follow<'a> for TableInNestedNS<'a> { 411 type Inner = TableInNestedNS<'a>; 412 #[inline] follow(buf: &'a [u8], loc: usize) -> Self::Inner413 fn follow(buf: &'a [u8], loc: usize) -> Self::Inner { 414 Self { _tab: flatbuffers::Table { buf, loc } } 415 } 416 } 417 418 impl<'a> TableInNestedNS<'a> { get_fully_qualified_name() -> &'static str419 pub const fn get_fully_qualified_name() -> &'static str { 420 "NamespaceA.NamespaceB.TableInNestedNS" 421 } 422 423 #[inline] init_from_table(table: flatbuffers::Table<'a>) -> Self424 pub fn init_from_table(table: flatbuffers::Table<'a>) -> Self { 425 TableInNestedNS { _tab: table } 426 } 427 #[allow(unused_mut)] create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>( _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>, args: &'args TableInNestedNSArgs) -> flatbuffers::WIPOffset<TableInNestedNS<'bldr>>428 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>( 429 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>, 430 args: &'args TableInNestedNSArgs) -> flatbuffers::WIPOffset<TableInNestedNS<'bldr>> { 431 let mut builder = TableInNestedNSBuilder::new(_fbb); 432 builder.add_foo(args.foo); 433 builder.finish() 434 } 435 unpack(&self) -> TableInNestedNST436 pub fn unpack(&self) -> TableInNestedNST { 437 let foo = self.foo(); 438 TableInNestedNST { 439 foo, 440 } 441 } 442 pub const VT_FOO: flatbuffers::VOffsetT = 4; 443 444 #[inline] foo(&self) -> i32445 pub fn foo(&self) -> i32 { 446 self._tab.get::<i32>(TableInNestedNS::VT_FOO, Some(0)).unwrap() 447 } 448 } 449 450 impl flatbuffers::Verifiable for TableInNestedNS<'_> { 451 #[inline] run_verifier( v: &mut flatbuffers::Verifier, pos: usize ) -> Result<(), flatbuffers::InvalidFlatbuffer>452 fn run_verifier( 453 v: &mut flatbuffers::Verifier, pos: usize 454 ) -> Result<(), flatbuffers::InvalidFlatbuffer> { 455 use self::flatbuffers::Verifiable; 456 v.visit_table(pos)? 457 .visit_field::<i32>(&"foo", Self::VT_FOO, false)? 458 .finish(); 459 Ok(()) 460 } 461 } 462 pub struct TableInNestedNSArgs { 463 pub foo: i32, 464 } 465 impl<'a> Default for TableInNestedNSArgs { 466 #[inline] default() -> Self467 fn default() -> Self { 468 TableInNestedNSArgs { 469 foo: 0, 470 } 471 } 472 } 473 pub struct TableInNestedNSBuilder<'a: 'b, 'b> { 474 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a>, 475 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>, 476 } 477 impl<'a: 'b, 'b> TableInNestedNSBuilder<'a, 'b> { 478 #[inline] add_foo(&mut self, foo: i32)479 pub fn add_foo(&mut self, foo: i32) { 480 self.fbb_.push_slot::<i32>(TableInNestedNS::VT_FOO, foo, 0); 481 } 482 #[inline] new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> TableInNestedNSBuilder<'a, 'b>483 pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> TableInNestedNSBuilder<'a, 'b> { 484 let start = _fbb.start_table(); 485 TableInNestedNSBuilder { 486 fbb_: _fbb, 487 start_: start, 488 } 489 } 490 #[inline] finish(self) -> flatbuffers::WIPOffset<TableInNestedNS<'a>>491 pub fn finish(self) -> flatbuffers::WIPOffset<TableInNestedNS<'a>> { 492 let o = self.fbb_.end_table(self.start_); 493 flatbuffers::WIPOffset::new(o.value()) 494 } 495 } 496 497 impl std::fmt::Debug for TableInNestedNS<'_> { fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result498 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 499 let mut ds = f.debug_struct("TableInNestedNS"); 500 ds.field("foo", &self.foo()); 501 ds.finish() 502 } 503 } 504 #[non_exhaustive] 505 #[derive(Debug, Clone, PartialEq)] 506 pub struct TableInNestedNST { 507 pub foo: i32, 508 } 509 impl Default for TableInNestedNST { default() -> Self510 fn default() -> Self { 511 Self { 512 foo: 0, 513 } 514 } 515 } 516 impl TableInNestedNST { pack<'b>( &self, _fbb: &mut flatbuffers::FlatBufferBuilder<'b> ) -> flatbuffers::WIPOffset<TableInNestedNS<'b>>517 pub fn pack<'b>( 518 &self, 519 _fbb: &mut flatbuffers::FlatBufferBuilder<'b> 520 ) -> flatbuffers::WIPOffset<TableInNestedNS<'b>> { 521 let foo = self.foo; 522 TableInNestedNS::create(_fbb, &TableInNestedNSArgs{ 523 foo, 524 }) 525 } 526 } 527 } // pub mod NamespaceB 528 529 pub enum TableInFirstNSOffset {} 530 #[derive(Copy, Clone, PartialEq)] 531 532 pub struct TableInFirstNS<'a> { 533 pub _tab: flatbuffers::Table<'a>, 534 } 535 536 impl<'a> flatbuffers::Follow<'a> for TableInFirstNS<'a> { 537 type Inner = TableInFirstNS<'a>; 538 #[inline] follow(buf: &'a [u8], loc: usize) -> Self::Inner539 fn follow(buf: &'a [u8], loc: usize) -> Self::Inner { 540 Self { _tab: flatbuffers::Table { buf, loc } } 541 } 542 } 543 544 impl<'a> TableInFirstNS<'a> { get_fully_qualified_name() -> &'static str545 pub const fn get_fully_qualified_name() -> &'static str { 546 "NamespaceA.TableInFirstNS" 547 } 548 549 #[inline] init_from_table(table: flatbuffers::Table<'a>) -> Self550 pub fn init_from_table(table: flatbuffers::Table<'a>) -> Self { 551 TableInFirstNS { _tab: table } 552 } 553 #[allow(unused_mut)] create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>( _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>, args: &'args TableInFirstNSArgs<'args>) -> flatbuffers::WIPOffset<TableInFirstNS<'bldr>>554 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>( 555 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>, 556 args: &'args TableInFirstNSArgs<'args>) -> flatbuffers::WIPOffset<TableInFirstNS<'bldr>> { 557 let mut builder = TableInFirstNSBuilder::new(_fbb); 558 if let Some(x) = args.foo_struct { builder.add_foo_struct(x); } 559 if let Some(x) = args.foo_union { builder.add_foo_union(x); } 560 if let Some(x) = args.foo_table { builder.add_foo_table(x); } 561 builder.add_foo_union_type(args.foo_union_type); 562 builder.add_foo_enum(args.foo_enum); 563 builder.finish() 564 } 565 unpack(&self) -> TableInFirstNST566 pub fn unpack(&self) -> TableInFirstNST { 567 let foo_table = self.foo_table().map(|x| { 568 Box::new(x.unpack()) 569 }); 570 let foo_enum = self.foo_enum(); 571 let foo_union = match self.foo_union_type() { 572 namespace_b::UnionInNestedNS::NONE => namespace_b::UnionInNestedNST::NONE, 573 namespace_b::UnionInNestedNS::TableInNestedNS => namespace_b::UnionInNestedNST::TableInNestedNS(Box::new( 574 self.foo_union_as_table_in_nested_ns() 575 .expect("Invalid union table, expected `namespace_b::UnionInNestedNS::TableInNestedNS`.") 576 .unpack() 577 )), 578 _ => namespace_b::UnionInNestedNST::NONE, 579 }; 580 let foo_struct = self.foo_struct().map(|x| { 581 x.unpack() 582 }); 583 TableInFirstNST { 584 foo_table, 585 foo_enum, 586 foo_union, 587 foo_struct, 588 } 589 } 590 pub const VT_FOO_TABLE: flatbuffers::VOffsetT = 4; 591 pub const VT_FOO_ENUM: flatbuffers::VOffsetT = 6; 592 pub const VT_FOO_UNION_TYPE: flatbuffers::VOffsetT = 8; 593 pub const VT_FOO_UNION: flatbuffers::VOffsetT = 10; 594 pub const VT_FOO_STRUCT: flatbuffers::VOffsetT = 12; 595 596 #[inline] foo_table(&self) -> Option<namespace_b::TableInNestedNS<'a>>597 pub fn foo_table(&self) -> Option<namespace_b::TableInNestedNS<'a>> { 598 self._tab.get::<flatbuffers::ForwardsUOffset<namespace_b::TableInNestedNS>>(TableInFirstNS::VT_FOO_TABLE, None) 599 } 600 #[inline] foo_enum(&self) -> namespace_b::EnumInNestedNS601 pub fn foo_enum(&self) -> namespace_b::EnumInNestedNS { 602 self._tab.get::<namespace_b::EnumInNestedNS>(TableInFirstNS::VT_FOO_ENUM, Some(namespace_b::EnumInNestedNS::A)).unwrap() 603 } 604 #[inline] foo_union_type(&self) -> namespace_b::UnionInNestedNS605 pub fn foo_union_type(&self) -> namespace_b::UnionInNestedNS { 606 self._tab.get::<namespace_b::UnionInNestedNS>(TableInFirstNS::VT_FOO_UNION_TYPE, Some(namespace_b::UnionInNestedNS::NONE)).unwrap() 607 } 608 #[inline] foo_union(&self) -> Option<flatbuffers::Table<'a>>609 pub fn foo_union(&self) -> Option<flatbuffers::Table<'a>> { 610 self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Table<'a>>>(TableInFirstNS::VT_FOO_UNION, None) 611 } 612 #[inline] foo_struct(&self) -> Option<&'a namespace_b::StructInNestedNS>613 pub fn foo_struct(&self) -> Option<&'a namespace_b::StructInNestedNS> { 614 self._tab.get::<namespace_b::StructInNestedNS>(TableInFirstNS::VT_FOO_STRUCT, None) 615 } 616 #[inline] 617 #[allow(non_snake_case)] foo_union_as_table_in_nested_ns(&self) -> Option<namespace_b::TableInNestedNS<'a>>618 pub fn foo_union_as_table_in_nested_ns(&self) -> Option<namespace_b::TableInNestedNS<'a>> { 619 if self.foo_union_type() == namespace_b::UnionInNestedNS::TableInNestedNS { 620 self.foo_union().map(namespace_b::TableInNestedNS::init_from_table) 621 } else { 622 None 623 } 624 } 625 626 } 627 628 impl flatbuffers::Verifiable for TableInFirstNS<'_> { 629 #[inline] run_verifier( v: &mut flatbuffers::Verifier, pos: usize ) -> Result<(), flatbuffers::InvalidFlatbuffer>630 fn run_verifier( 631 v: &mut flatbuffers::Verifier, pos: usize 632 ) -> Result<(), flatbuffers::InvalidFlatbuffer> { 633 use self::flatbuffers::Verifiable; 634 v.visit_table(pos)? 635 .visit_field::<flatbuffers::ForwardsUOffset<namespace_b::TableInNestedNS>>(&"foo_table", Self::VT_FOO_TABLE, false)? 636 .visit_field::<namespace_b::EnumInNestedNS>(&"foo_enum", Self::VT_FOO_ENUM, false)? 637 .visit_union::<namespace_b::UnionInNestedNS, _>(&"foo_union_type", Self::VT_FOO_UNION_TYPE, &"foo_union", Self::VT_FOO_UNION, false, |key, v, pos| { 638 match key { 639 namespace_b::UnionInNestedNS::TableInNestedNS => v.verify_union_variant::<flatbuffers::ForwardsUOffset<namespace_b::TableInNestedNS>>("namespace_b::UnionInNestedNS::TableInNestedNS", pos), 640 _ => Ok(()), 641 } 642 })? 643 .visit_field::<namespace_b::StructInNestedNS>(&"foo_struct", Self::VT_FOO_STRUCT, false)? 644 .finish(); 645 Ok(()) 646 } 647 } 648 pub struct TableInFirstNSArgs<'a> { 649 pub foo_table: Option<flatbuffers::WIPOffset<namespace_b::TableInNestedNS<'a>>>, 650 pub foo_enum: namespace_b::EnumInNestedNS, 651 pub foo_union_type: namespace_b::UnionInNestedNS, 652 pub foo_union: Option<flatbuffers::WIPOffset<flatbuffers::UnionWIPOffset>>, 653 pub foo_struct: Option<&'a namespace_b::StructInNestedNS>, 654 } 655 impl<'a> Default for TableInFirstNSArgs<'a> { 656 #[inline] default() -> Self657 fn default() -> Self { 658 TableInFirstNSArgs { 659 foo_table: None, 660 foo_enum: namespace_b::EnumInNestedNS::A, 661 foo_union_type: namespace_b::UnionInNestedNS::NONE, 662 foo_union: None, 663 foo_struct: None, 664 } 665 } 666 } 667 pub struct TableInFirstNSBuilder<'a: 'b, 'b> { 668 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a>, 669 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>, 670 } 671 impl<'a: 'b, 'b> TableInFirstNSBuilder<'a, 'b> { 672 #[inline] add_foo_table(&mut self, foo_table: flatbuffers::WIPOffset<namespace_b::TableInNestedNS<'b >>)673 pub fn add_foo_table(&mut self, foo_table: flatbuffers::WIPOffset<namespace_b::TableInNestedNS<'b >>) { 674 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<namespace_b::TableInNestedNS>>(TableInFirstNS::VT_FOO_TABLE, foo_table); 675 } 676 #[inline] add_foo_enum(&mut self, foo_enum: namespace_b::EnumInNestedNS)677 pub fn add_foo_enum(&mut self, foo_enum: namespace_b::EnumInNestedNS) { 678 self.fbb_.push_slot::<namespace_b::EnumInNestedNS>(TableInFirstNS::VT_FOO_ENUM, foo_enum, namespace_b::EnumInNestedNS::A); 679 } 680 #[inline] add_foo_union_type(&mut self, foo_union_type: namespace_b::UnionInNestedNS)681 pub fn add_foo_union_type(&mut self, foo_union_type: namespace_b::UnionInNestedNS) { 682 self.fbb_.push_slot::<namespace_b::UnionInNestedNS>(TableInFirstNS::VT_FOO_UNION_TYPE, foo_union_type, namespace_b::UnionInNestedNS::NONE); 683 } 684 #[inline] add_foo_union(&mut self, foo_union: flatbuffers::WIPOffset<flatbuffers::UnionWIPOffset>)685 pub fn add_foo_union(&mut self, foo_union: flatbuffers::WIPOffset<flatbuffers::UnionWIPOffset>) { 686 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(TableInFirstNS::VT_FOO_UNION, foo_union); 687 } 688 #[inline] add_foo_struct(&mut self, foo_struct: &namespace_b::StructInNestedNS)689 pub fn add_foo_struct(&mut self, foo_struct: &namespace_b::StructInNestedNS) { 690 self.fbb_.push_slot_always::<&namespace_b::StructInNestedNS>(TableInFirstNS::VT_FOO_STRUCT, foo_struct); 691 } 692 #[inline] new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> TableInFirstNSBuilder<'a, 'b>693 pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> TableInFirstNSBuilder<'a, 'b> { 694 let start = _fbb.start_table(); 695 TableInFirstNSBuilder { 696 fbb_: _fbb, 697 start_: start, 698 } 699 } 700 #[inline] finish(self) -> flatbuffers::WIPOffset<TableInFirstNS<'a>>701 pub fn finish(self) -> flatbuffers::WIPOffset<TableInFirstNS<'a>> { 702 let o = self.fbb_.end_table(self.start_); 703 flatbuffers::WIPOffset::new(o.value()) 704 } 705 } 706 707 impl std::fmt::Debug for TableInFirstNS<'_> { fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result708 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 709 let mut ds = f.debug_struct("TableInFirstNS"); 710 ds.field("foo_table", &self.foo_table()); 711 ds.field("foo_enum", &self.foo_enum()); 712 ds.field("foo_union_type", &self.foo_union_type()); 713 match self.foo_union_type() { 714 namespace_b::UnionInNestedNS::TableInNestedNS => { 715 if let Some(x) = self.foo_union_as_table_in_nested_ns() { 716 ds.field("foo_union", &x) 717 } else { 718 ds.field("foo_union", &"InvalidFlatbuffer: Union discriminant does not match value.") 719 } 720 }, 721 _ => { 722 let x: Option<()> = None; 723 ds.field("foo_union", &x) 724 }, 725 }; 726 ds.field("foo_struct", &self.foo_struct()); 727 ds.finish() 728 } 729 } 730 #[non_exhaustive] 731 #[derive(Debug, Clone, PartialEq)] 732 pub struct TableInFirstNST { 733 pub foo_table: Option<Box<namespace_b::TableInNestedNST>>, 734 pub foo_enum: namespace_b::EnumInNestedNS, 735 pub foo_union: namespace_b::UnionInNestedNST, 736 pub foo_struct: Option<namespace_b::StructInNestedNST>, 737 } 738 impl Default for TableInFirstNST { default() -> Self739 fn default() -> Self { 740 Self { 741 foo_table: None, 742 foo_enum: namespace_b::EnumInNestedNS::A, 743 foo_union: namespace_b::UnionInNestedNST::NONE, 744 foo_struct: None, 745 } 746 } 747 } 748 impl TableInFirstNST { pack<'b>( &self, _fbb: &mut flatbuffers::FlatBufferBuilder<'b> ) -> flatbuffers::WIPOffset<TableInFirstNS<'b>>749 pub fn pack<'b>( 750 &self, 751 _fbb: &mut flatbuffers::FlatBufferBuilder<'b> 752 ) -> flatbuffers::WIPOffset<TableInFirstNS<'b>> { 753 let foo_table = self.foo_table.as_ref().map(|x|{ 754 x.pack(_fbb) 755 }); 756 let foo_enum = self.foo_enum; 757 let foo_union_type = self.foo_union.union_in_nested_ns_type(); 758 let foo_union = self.foo_union.pack(_fbb); 759 let foo_struct_tmp = self.foo_struct.as_ref().map(|x| x.pack()); 760 let foo_struct = foo_struct_tmp.as_ref(); 761 TableInFirstNS::create(_fbb, &TableInFirstNSArgs{ 762 foo_table, 763 foo_enum, 764 foo_union_type, 765 foo_union, 766 foo_struct, 767 }) 768 } 769 } 770 pub enum SecondTableInAOffset {} 771 #[derive(Copy, Clone, PartialEq)] 772 773 pub struct SecondTableInA<'a> { 774 pub _tab: flatbuffers::Table<'a>, 775 } 776 777 impl<'a> flatbuffers::Follow<'a> for SecondTableInA<'a> { 778 type Inner = SecondTableInA<'a>; 779 #[inline] follow(buf: &'a [u8], loc: usize) -> Self::Inner780 fn follow(buf: &'a [u8], loc: usize) -> Self::Inner { 781 Self { _tab: flatbuffers::Table { buf, loc } } 782 } 783 } 784 785 impl<'a> SecondTableInA<'a> { get_fully_qualified_name() -> &'static str786 pub const fn get_fully_qualified_name() -> &'static str { 787 "NamespaceA.SecondTableInA" 788 } 789 790 #[inline] init_from_table(table: flatbuffers::Table<'a>) -> Self791 pub fn init_from_table(table: flatbuffers::Table<'a>) -> Self { 792 SecondTableInA { _tab: table } 793 } 794 #[allow(unused_mut)] create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>( _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>, args: &'args SecondTableInAArgs<'args>) -> flatbuffers::WIPOffset<SecondTableInA<'bldr>>795 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>( 796 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>, 797 args: &'args SecondTableInAArgs<'args>) -> flatbuffers::WIPOffset<SecondTableInA<'bldr>> { 798 let mut builder = SecondTableInABuilder::new(_fbb); 799 if let Some(x) = args.refer_to_c { builder.add_refer_to_c(x); } 800 builder.finish() 801 } 802 unpack(&self) -> SecondTableInAT803 pub fn unpack(&self) -> SecondTableInAT { 804 let refer_to_c = self.refer_to_c().map(|x| { 805 Box::new(x.unpack()) 806 }); 807 SecondTableInAT { 808 refer_to_c, 809 } 810 } 811 pub const VT_REFER_TO_C: flatbuffers::VOffsetT = 4; 812 813 #[inline] refer_to_c(&self) -> Option<super::namespace_c::TableInC<'a>>814 pub fn refer_to_c(&self) -> Option<super::namespace_c::TableInC<'a>> { 815 self._tab.get::<flatbuffers::ForwardsUOffset<super::namespace_c::TableInC>>(SecondTableInA::VT_REFER_TO_C, None) 816 } 817 } 818 819 impl flatbuffers::Verifiable for SecondTableInA<'_> { 820 #[inline] run_verifier( v: &mut flatbuffers::Verifier, pos: usize ) -> Result<(), flatbuffers::InvalidFlatbuffer>821 fn run_verifier( 822 v: &mut flatbuffers::Verifier, pos: usize 823 ) -> Result<(), flatbuffers::InvalidFlatbuffer> { 824 use self::flatbuffers::Verifiable; 825 v.visit_table(pos)? 826 .visit_field::<flatbuffers::ForwardsUOffset<super::namespace_c::TableInC>>(&"refer_to_c", Self::VT_REFER_TO_C, false)? 827 .finish(); 828 Ok(()) 829 } 830 } 831 pub struct SecondTableInAArgs<'a> { 832 pub refer_to_c: Option<flatbuffers::WIPOffset<super::namespace_c::TableInC<'a>>>, 833 } 834 impl<'a> Default for SecondTableInAArgs<'a> { 835 #[inline] default() -> Self836 fn default() -> Self { 837 SecondTableInAArgs { 838 refer_to_c: None, 839 } 840 } 841 } 842 pub struct SecondTableInABuilder<'a: 'b, 'b> { 843 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a>, 844 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>, 845 } 846 impl<'a: 'b, 'b> SecondTableInABuilder<'a, 'b> { 847 #[inline] add_refer_to_c(&mut self, refer_to_c: flatbuffers::WIPOffset<super::namespace_c::TableInC<'b >>)848 pub fn add_refer_to_c(&mut self, refer_to_c: flatbuffers::WIPOffset<super::namespace_c::TableInC<'b >>) { 849 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<super::namespace_c::TableInC>>(SecondTableInA::VT_REFER_TO_C, refer_to_c); 850 } 851 #[inline] new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> SecondTableInABuilder<'a, 'b>852 pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> SecondTableInABuilder<'a, 'b> { 853 let start = _fbb.start_table(); 854 SecondTableInABuilder { 855 fbb_: _fbb, 856 start_: start, 857 } 858 } 859 #[inline] finish(self) -> flatbuffers::WIPOffset<SecondTableInA<'a>>860 pub fn finish(self) -> flatbuffers::WIPOffset<SecondTableInA<'a>> { 861 let o = self.fbb_.end_table(self.start_); 862 flatbuffers::WIPOffset::new(o.value()) 863 } 864 } 865 866 impl std::fmt::Debug for SecondTableInA<'_> { fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result867 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 868 let mut ds = f.debug_struct("SecondTableInA"); 869 ds.field("refer_to_c", &self.refer_to_c()); 870 ds.finish() 871 } 872 } 873 #[non_exhaustive] 874 #[derive(Debug, Clone, PartialEq)] 875 pub struct SecondTableInAT { 876 pub refer_to_c: Option<Box<super::namespace_c::TableInCT>>, 877 } 878 impl Default for SecondTableInAT { default() -> Self879 fn default() -> Self { 880 Self { 881 refer_to_c: None, 882 } 883 } 884 } 885 impl SecondTableInAT { pack<'b>( &self, _fbb: &mut flatbuffers::FlatBufferBuilder<'b> ) -> flatbuffers::WIPOffset<SecondTableInA<'b>>886 pub fn pack<'b>( 887 &self, 888 _fbb: &mut flatbuffers::FlatBufferBuilder<'b> 889 ) -> flatbuffers::WIPOffset<SecondTableInA<'b>> { 890 let refer_to_c = self.refer_to_c.as_ref().map(|x|{ 891 x.pack(_fbb) 892 }); 893 SecondTableInA::create(_fbb, &SecondTableInAArgs{ 894 refer_to_c, 895 }) 896 } 897 } 898 } // pub mod NamespaceA 899 900 #[allow(unused_imports, dead_code)] 901 pub mod namespace_c { 902 903 use std::mem; 904 use std::cmp::Ordering; 905 906 extern crate flatbuffers; 907 use self::flatbuffers::{EndianScalar, Follow}; 908 909 pub enum TableInCOffset {} 910 #[derive(Copy, Clone, PartialEq)] 911 912 pub struct TableInC<'a> { 913 pub _tab: flatbuffers::Table<'a>, 914 } 915 916 impl<'a> flatbuffers::Follow<'a> for TableInC<'a> { 917 type Inner = TableInC<'a>; 918 #[inline] follow(buf: &'a [u8], loc: usize) -> Self::Inner919 fn follow(buf: &'a [u8], loc: usize) -> Self::Inner { 920 Self { _tab: flatbuffers::Table { buf, loc } } 921 } 922 } 923 924 impl<'a> TableInC<'a> { get_fully_qualified_name() -> &'static str925 pub const fn get_fully_qualified_name() -> &'static str { 926 "NamespaceC.TableInC" 927 } 928 929 #[inline] init_from_table(table: flatbuffers::Table<'a>) -> Self930 pub fn init_from_table(table: flatbuffers::Table<'a>) -> Self { 931 TableInC { _tab: table } 932 } 933 #[allow(unused_mut)] create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>( _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>, args: &'args TableInCArgs<'args>) -> flatbuffers::WIPOffset<TableInC<'bldr>>934 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>( 935 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>, 936 args: &'args TableInCArgs<'args>) -> flatbuffers::WIPOffset<TableInC<'bldr>> { 937 let mut builder = TableInCBuilder::new(_fbb); 938 if let Some(x) = args.refer_to_a2 { builder.add_refer_to_a2(x); } 939 if let Some(x) = args.refer_to_a1 { builder.add_refer_to_a1(x); } 940 builder.finish() 941 } 942 unpack(&self) -> TableInCT943 pub fn unpack(&self) -> TableInCT { 944 let refer_to_a1 = self.refer_to_a1().map(|x| { 945 Box::new(x.unpack()) 946 }); 947 let refer_to_a2 = self.refer_to_a2().map(|x| { 948 Box::new(x.unpack()) 949 }); 950 TableInCT { 951 refer_to_a1, 952 refer_to_a2, 953 } 954 } 955 pub const VT_REFER_TO_A1: flatbuffers::VOffsetT = 4; 956 pub const VT_REFER_TO_A2: flatbuffers::VOffsetT = 6; 957 958 #[inline] refer_to_a1(&self) -> Option<super::namespace_a::TableInFirstNS<'a>>959 pub fn refer_to_a1(&self) -> Option<super::namespace_a::TableInFirstNS<'a>> { 960 self._tab.get::<flatbuffers::ForwardsUOffset<super::namespace_a::TableInFirstNS>>(TableInC::VT_REFER_TO_A1, None) 961 } 962 #[inline] refer_to_a2(&self) -> Option<super::namespace_a::SecondTableInA<'a>>963 pub fn refer_to_a2(&self) -> Option<super::namespace_a::SecondTableInA<'a>> { 964 self._tab.get::<flatbuffers::ForwardsUOffset<super::namespace_a::SecondTableInA>>(TableInC::VT_REFER_TO_A2, None) 965 } 966 } 967 968 impl flatbuffers::Verifiable for TableInC<'_> { 969 #[inline] run_verifier( v: &mut flatbuffers::Verifier, pos: usize ) -> Result<(), flatbuffers::InvalidFlatbuffer>970 fn run_verifier( 971 v: &mut flatbuffers::Verifier, pos: usize 972 ) -> Result<(), flatbuffers::InvalidFlatbuffer> { 973 use self::flatbuffers::Verifiable; 974 v.visit_table(pos)? 975 .visit_field::<flatbuffers::ForwardsUOffset<super::namespace_a::TableInFirstNS>>(&"refer_to_a1", Self::VT_REFER_TO_A1, false)? 976 .visit_field::<flatbuffers::ForwardsUOffset<super::namespace_a::SecondTableInA>>(&"refer_to_a2", Self::VT_REFER_TO_A2, false)? 977 .finish(); 978 Ok(()) 979 } 980 } 981 pub struct TableInCArgs<'a> { 982 pub refer_to_a1: Option<flatbuffers::WIPOffset<super::namespace_a::TableInFirstNS<'a>>>, 983 pub refer_to_a2: Option<flatbuffers::WIPOffset<super::namespace_a::SecondTableInA<'a>>>, 984 } 985 impl<'a> Default for TableInCArgs<'a> { 986 #[inline] default() -> Self987 fn default() -> Self { 988 TableInCArgs { 989 refer_to_a1: None, 990 refer_to_a2: None, 991 } 992 } 993 } 994 pub struct TableInCBuilder<'a: 'b, 'b> { 995 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a>, 996 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>, 997 } 998 impl<'a: 'b, 'b> TableInCBuilder<'a, 'b> { 999 #[inline] add_refer_to_a1(&mut self, refer_to_a1: flatbuffers::WIPOffset<super::namespace_a::TableInFirstNS<'b >>)1000 pub fn add_refer_to_a1(&mut self, refer_to_a1: flatbuffers::WIPOffset<super::namespace_a::TableInFirstNS<'b >>) { 1001 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<super::namespace_a::TableInFirstNS>>(TableInC::VT_REFER_TO_A1, refer_to_a1); 1002 } 1003 #[inline] add_refer_to_a2(&mut self, refer_to_a2: flatbuffers::WIPOffset<super::namespace_a::SecondTableInA<'b >>)1004 pub fn add_refer_to_a2(&mut self, refer_to_a2: flatbuffers::WIPOffset<super::namespace_a::SecondTableInA<'b >>) { 1005 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<super::namespace_a::SecondTableInA>>(TableInC::VT_REFER_TO_A2, refer_to_a2); 1006 } 1007 #[inline] new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> TableInCBuilder<'a, 'b>1008 pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> TableInCBuilder<'a, 'b> { 1009 let start = _fbb.start_table(); 1010 TableInCBuilder { 1011 fbb_: _fbb, 1012 start_: start, 1013 } 1014 } 1015 #[inline] finish(self) -> flatbuffers::WIPOffset<TableInC<'a>>1016 pub fn finish(self) -> flatbuffers::WIPOffset<TableInC<'a>> { 1017 let o = self.fbb_.end_table(self.start_); 1018 flatbuffers::WIPOffset::new(o.value()) 1019 } 1020 } 1021 1022 impl std::fmt::Debug for TableInC<'_> { fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result1023 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 1024 let mut ds = f.debug_struct("TableInC"); 1025 ds.field("refer_to_a1", &self.refer_to_a1()); 1026 ds.field("refer_to_a2", &self.refer_to_a2()); 1027 ds.finish() 1028 } 1029 } 1030 #[non_exhaustive] 1031 #[derive(Debug, Clone, PartialEq)] 1032 pub struct TableInCT { 1033 pub refer_to_a1: Option<Box<super::namespace_a::TableInFirstNST>>, 1034 pub refer_to_a2: Option<Box<super::namespace_a::SecondTableInAT>>, 1035 } 1036 impl Default for TableInCT { default() -> Self1037 fn default() -> Self { 1038 Self { 1039 refer_to_a1: None, 1040 refer_to_a2: None, 1041 } 1042 } 1043 } 1044 impl TableInCT { pack<'b>( &self, _fbb: &mut flatbuffers::FlatBufferBuilder<'b> ) -> flatbuffers::WIPOffset<TableInC<'b>>1045 pub fn pack<'b>( 1046 &self, 1047 _fbb: &mut flatbuffers::FlatBufferBuilder<'b> 1048 ) -> flatbuffers::WIPOffset<TableInC<'b>> { 1049 let refer_to_a1 = self.refer_to_a1.as_ref().map(|x|{ 1050 x.pack(_fbb) 1051 }); 1052 let refer_to_a2 = self.refer_to_a2.as_ref().map(|x|{ 1053 x.pack(_fbb) 1054 }); 1055 TableInC::create(_fbb, &TableInCArgs{ 1056 refer_to_a1, 1057 refer_to_a2, 1058 }) 1059 } 1060 } 1061 } // pub mod NamespaceC 1062 1063