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 TableAOffset {} 13 #[derive(Copy, Clone, PartialEq)] 14 15 pub struct TableA<'a> { 16 pub _tab: flatbuffers::Table<'a>, 17 } 18 19 impl<'a> flatbuffers::Follow<'a> for TableA<'a> { 20 type Inner = TableA<'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> TableA<'a> { 28 pub const VT_B: flatbuffers::VOffsetT = 4; 29 get_fully_qualified_name() -> &'static str30 pub const fn get_fully_qualified_name() -> &'static str { 31 "TableA" 32 } 33 34 #[inline] init_from_table(table: flatbuffers::Table<'a>) -> Self35 pub fn init_from_table(table: flatbuffers::Table<'a>) -> Self { 36 TableA { _tab: table } 37 } 38 #[allow(unused_mut)] create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>( _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>, args: &'args TableAArgs<'args> ) -> flatbuffers::WIPOffset<TableA<'bldr>>39 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>( 40 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>, 41 args: &'args TableAArgs<'args> 42 ) -> flatbuffers::WIPOffset<TableA<'bldr>> { 43 let mut builder = TableABuilder::new(_fbb); 44 if let Some(x) = args.b { builder.add_b(x); } 45 builder.finish() 46 } 47 unpack(&self) -> TableAT48 pub fn unpack(&self) -> TableAT { 49 let b = self.b().map(|x| { 50 Box::new(x.unpack()) 51 }); 52 TableAT { 53 b, 54 } 55 } 56 57 #[inline] b(&self) -> Option<my_game::other_name_space::TableB<'a>>58 pub fn b(&self) -> Option<my_game::other_name_space::TableB<'a>> { 59 self._tab.get::<flatbuffers::ForwardsUOffset<my_game::other_name_space::TableB>>(TableA::VT_B, None) 60 } 61 } 62 63 impl flatbuffers::Verifiable for TableA<'_> { 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::<flatbuffers::ForwardsUOffset<my_game::other_name_space::TableB>>("b", Self::VT_B, false)? 71 .finish(); 72 Ok(()) 73 } 74 } 75 pub struct TableAArgs<'a> { 76 pub b: Option<flatbuffers::WIPOffset<my_game::other_name_space::TableB<'a>>>, 77 } 78 impl<'a> Default for TableAArgs<'a> { 79 #[inline] default() -> Self80 fn default() -> Self { 81 TableAArgs { 82 b: None, 83 } 84 } 85 } 86 87 pub struct TableABuilder<'a: 'b, 'b> { 88 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a>, 89 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>, 90 } 91 impl<'a: 'b, 'b> TableABuilder<'a, 'b> { 92 #[inline] add_b(&mut self, b: flatbuffers::WIPOffset<my_game::other_name_space::TableB<'b >>)93 pub fn add_b(&mut self, b: flatbuffers::WIPOffset<my_game::other_name_space::TableB<'b >>) { 94 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<my_game::other_name_space::TableB>>(TableA::VT_B, b); 95 } 96 #[inline] new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> TableABuilder<'a, 'b>97 pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> TableABuilder<'a, 'b> { 98 let start = _fbb.start_table(); 99 TableABuilder { 100 fbb_: _fbb, 101 start_: start, 102 } 103 } 104 #[inline] finish(self) -> flatbuffers::WIPOffset<TableA<'a>>105 pub fn finish(self) -> flatbuffers::WIPOffset<TableA<'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 TableA<'_> { 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("TableA"); 114 ds.field("b", &self.b()); 115 ds.finish() 116 } 117 } 118 #[non_exhaustive] 119 #[derive(Debug, Clone, PartialEq)] 120 pub struct TableAT { 121 pub b: Option<Box<my_game::other_name_space::TableBT>>, 122 } 123 impl Default for TableAT { default() -> Self124 fn default() -> Self { 125 Self { 126 b: None, 127 } 128 } 129 } 130 impl TableAT { pack<'b>( &self, _fbb: &mut flatbuffers::FlatBufferBuilder<'b> ) -> flatbuffers::WIPOffset<TableA<'b>>131 pub fn pack<'b>( 132 &self, 133 _fbb: &mut flatbuffers::FlatBufferBuilder<'b> 134 ) -> flatbuffers::WIPOffset<TableA<'b>> { 135 let b = self.b.as_ref().map(|x|{ 136 x.pack(_fbb) 137 }); 138 TableA::create(_fbb, &TableAArgs{ 139 b, 140 }) 141 } 142 } 143