| 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 TableInNestedNSOffset {} |
| 13 |
#[derive(Copy, Clone, PartialEq)] |
| 14 |
|
| 15 |
pub struct TableInNestedNS<'a> { |
| 16 |
pub _tab: flatbuffers::Table<'a>, |
| 17 |
} |
| 18 |
|
| 19 |
impl<'a> flatbuffers::Follow<'a> for TableInNestedNS<'a> { |
| 20 |
type Inner = TableInNestedNS<'a>; |
| 21 |
#[inline] |
| 22 |
unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner { |
| 23 |
Self { _tab: flatbuffers::Table::new(buf, loc) } |
| 24 |
} |
| 25 |
} |
| 26 |
|
| 27 |
impl<'a> TableInNestedNS<'a> { |
| 28 |
pub const VT_FOO: flatbuffers::VOffsetT = 4; |
| 29 |
|
| 30 |
pub const fn get_fully_qualified_name() -> &'static str { |
| 31 |
"NamespaceA.NamespaceB.TableInNestedNS" |
| 32 |
} |
| 33 |
|
| 34 |
#[inline] |
| 35 |
pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self { |
| 36 |
TableInNestedNS { _tab: table } |
| 37 |
} |
| 38 |
#[allow(unused_mut)] |
| 39 |
pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>( |
| 40 |
_fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>, |
| 41 |
args: &'args TableInNestedNSArgs |
| 42 |
) -> flatbuffers::WIPOffset<TableInNestedNS<'bldr>> { |
| 43 |
let mut builder = TableInNestedNSBuilder::new(_fbb); |
| 44 |
builder.add_foo(args.foo); |
| 45 |
builder.finish() |
| 46 |
} |
| 47 |
|
| 48 |
pub fn unpack(&self) -> TableInNestedNST { |
| 49 |
let foo = self.foo(); |
| 50 |
TableInNestedNST { |
| 51 |
foo, |
| 52 |
} |
| 53 |
} |
| 54 |
|
| 55 |
#[inline] |
| 56 |
pub fn foo(&self) -> i32 { |
| 57 |
// Safety: |
| 58 |
// Created from valid Table for this object |
| 59 |
// which contains a valid value in this slot |
| 60 |
unsafe { self._tab.get::<i32>(TableInNestedNS::VT_FOO, Some(0)).unwrap()} |
| 61 |
} |
| 62 |
} |
| 63 |
|
| 64 |
impl flatbuffers::Verifiable for TableInNestedNS<'_> { |
| 65 |
#[inline] |
| 66 |
fn run_verifier( |
| 67 |
v: &mut flatbuffers::Verifier, pos: usize |
| 68 |
) -> Result<(), flatbuffers::InvalidFlatbuffer> { |
| 69 |
use self::flatbuffers::Verifiable; |
| 70 |
v.visit_table(pos)? |
| 71 |
.visit_field::<i32>("foo", Self::VT_FOO, false)? |
| 72 |
.finish(); |
| 73 |
Ok(()) |
| 74 |
} |
| 75 |
} |
| 76 |
pub struct TableInNestedNSArgs { |
| 77 |
pub foo: i32, |
| 78 |
} |
| 79 |
impl<'a> Default for TableInNestedNSArgs { |
| 80 |
#[inline] |
| 81 |
fn default() -> Self { |
| 82 |
TableInNestedNSArgs { |
| 83 |
foo: 0, |
| 84 |
} |
| 85 |
} |
| 86 |
} |
| 87 |
|
| 88 |
pub struct TableInNestedNSBuilder<'a: 'b, 'b> { |
| 89 |
fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a>, |
| 90 |
start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>, |
| 91 |
} |
| 92 |
impl<'a: 'b, 'b> TableInNestedNSBuilder<'a, 'b> { |
| 93 |
#[inline] |
| 94 |
pub fn add_foo(&mut self, foo: i32) { |
| 95 |
self.fbb_.push_slot::<i32>(TableInNestedNS::VT_FOO, foo, 0); |
| 96 |
} |
| 97 |
#[inline] |
| 98 |
pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> TableInNestedNSBuilder<'a, 'b> { |
| 99 |
let start = _fbb.start_table(); |
| 100 |
TableInNestedNSBuilder { |
| 101 |
fbb_: _fbb, |
| 102 |
start_: start, |
| 103 |
} |
| 104 |
} |
| 105 |
#[inline] |
| 106 |
pub fn finish(self) -> flatbuffers::WIPOffset<TableInNestedNS<'a>> { |
| 107 |
let o = self.fbb_.end_table(self.start_); |
| 108 |
flatbuffers::WIPOffset::new(o.value()) |
| 109 |
} |
| 110 |
} |
| 111 |
|
| 112 |
impl core::fmt::Debug for TableInNestedNS<'_> { |
| 113 |
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { |
| 114 |
let mut ds = f.debug_struct("TableInNestedNS"); |
| 115 |
ds.field("foo", &self.foo()); |
| 116 |
ds.finish() |
| 117 |
} |
| 118 |
} |
| 119 |
#[non_exhaustive] |
| 120 |
#[derive(Debug, Clone, PartialEq)] |
| 121 |
pub struct TableInNestedNST { |
| 122 |
pub foo: i32, |
| 123 |
} |
| 124 |
impl Default for TableInNestedNST { |
| 125 |
fn default() -> Self { |
| 126 |
Self { |
| 127 |
foo: 0, |
| 128 |
} |
| 129 |
} |
| 130 |
} |
| 131 |
impl TableInNestedNST { |
| 132 |
pub fn pack<'b>( |
| 133 |
&self, |
| 134 |
_fbb: &mut flatbuffers::FlatBufferBuilder<'b> |
| 135 |
) -> flatbuffers::WIPOffset<TableInNestedNS<'b>> { |
| 136 |
let foo = self.foo; |
| 137 |
TableInNestedNS::create(_fbb, &TableInNestedNSArgs{ |
| 138 |
foo, |
| 139 |
}) |
| 140 |
} |
| 141 |
} |