summaryrefslogtreecommitdiff
path: root/tests/namespace_test
diff options
context:
space:
mode:
Diffstat (limited to 'tests/namespace_test')
-rw-r--r--tests/namespace_test/namespace_test1_generated.rs43
-rw-r--r--tests/namespace_test/namespace_test2_generated.rs47
2 files changed, 82 insertions, 8 deletions
diff --git a/tests/namespace_test/namespace_test1_generated.rs b/tests/namespace_test/namespace_test1_generated.rs
index dd735a60..b5f062b1 100644
--- a/tests/namespace_test/namespace_test1_generated.rs
+++ b/tests/namespace_test/namespace_test1_generated.rs
@@ -77,7 +77,8 @@ impl<'a> flatbuffers::Follow<'a> for EnumInNestedNS {
type Inner = Self;
#[inline]
fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
- Self(flatbuffers::read_scalar_at::<i8>(buf, loc))
+ let b = flatbuffers::read_scalar_at::<i8>(buf, loc);
+ Self(b)
}
}
@@ -92,14 +93,27 @@ impl flatbuffers::Push for EnumInNestedNS {
impl flatbuffers::EndianScalar for EnumInNestedNS {
#[inline]
fn to_little_endian(self) -> Self {
- Self(i8::to_le(self.0))
+ let b = i8::to_le(self.0);
+ Self(b)
}
#[inline]
fn from_little_endian(self) -> Self {
- Self(i8::from_le(self.0))
+ let b = i8::from_le(self.0);
+ Self(b)
}
}
+impl<'a> flatbuffers::Verifiable for EnumInNestedNS {
+ #[inline]
+ fn run_verifier<'o, 'b>(
+ v: &mut flatbuffers::Verifier<'o, 'b>, pos: usize
+ ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
+ use self::flatbuffers::Verifiable;
+ i8::run_verifier(v, pos)
+ }
+}
+
+impl flatbuffers::SimpleToVerifyInSlice for EnumInNestedNS {}
// struct StructInNestedNS, aligned to 4
#[repr(C, align(4))]
#[derive(Clone, Copy, PartialEq)]
@@ -116,6 +130,7 @@ impl std::fmt::Debug for StructInNestedNS {
}
}
+impl flatbuffers::SimpleToVerifyInSlice for StructInNestedNS {}
impl flatbuffers::SafeSliceAccess for StructInNestedNS {}
impl<'a> flatbuffers::Follow<'a> for StructInNestedNS {
type Inner = &'a StructInNestedNS;
@@ -153,7 +168,15 @@ impl<'b> flatbuffers::Push for &'b StructInNestedNS {
}
}
-
+impl<'a> flatbuffers::Verifiable for StructInNestedNS {
+ #[inline]
+ fn run_verifier<'o, 'b>(
+ v: &mut flatbuffers::Verifier<'o, 'b>, pos: usize
+ ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
+ use self::flatbuffers::Verifiable;
+ v.in_buffer::<Self>(pos)
+ }
+}
impl StructInNestedNS {
pub fn new(_a: i32, _b: i32) -> Self {
StructInNestedNS {
@@ -217,6 +240,18 @@ impl<'a> TableInNestedNS<'a> {
}
}
+impl flatbuffers::Verifiable for TableInNestedNS<'_> {
+ #[inline]
+ fn run_verifier<'o, 'b>(
+ v: &mut flatbuffers::Verifier<'o, 'b>, pos: usize
+ ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
+ use self::flatbuffers::Verifiable;
+ v.visit_table(pos)?
+ .visit_field::<i32>(&"foo", Self::VT_FOO, false)?
+ .finish();
+ Ok(())
+ }
+}
pub struct TableInNestedNSArgs {
pub foo: i32,
}
diff --git a/tests/namespace_test/namespace_test2_generated.rs b/tests/namespace_test/namespace_test2_generated.rs
index b1d84cf0..64120050 100644
--- a/tests/namespace_test/namespace_test2_generated.rs
+++ b/tests/namespace_test/namespace_test2_generated.rs
@@ -63,7 +63,7 @@ impl<'a> TableInFirstNS<'a> {
#[inline]
pub fn foo_table(&self) -> Option<namespace_b::TableInNestedNS<'a>> {
- self._tab.get::<flatbuffers::ForwardsUOffset<namespace_b::TableInNestedNS<'a>>>(TableInFirstNS::VT_FOO_TABLE, None)
+ self._tab.get::<flatbuffers::ForwardsUOffset<namespace_b::TableInNestedNS>>(TableInFirstNS::VT_FOO_TABLE, None)
}
#[inline]
pub fn foo_enum(&self) -> namespace_b::EnumInNestedNS {
@@ -75,6 +75,20 @@ impl<'a> TableInFirstNS<'a> {
}
}
+impl flatbuffers::Verifiable for TableInFirstNS<'_> {
+ #[inline]
+ fn run_verifier<'o, 'b>(
+ v: &mut flatbuffers::Verifier<'o, 'b>, pos: usize
+ ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
+ use self::flatbuffers::Verifiable;
+ v.visit_table(pos)?
+ .visit_field::<flatbuffers::ForwardsUOffset<namespace_b::TableInNestedNS>>(&"foo_table", Self::VT_FOO_TABLE, false)?
+ .visit_field::<namespace_b::EnumInNestedNS>(&"foo_enum", Self::VT_FOO_ENUM, false)?
+ .visit_field::<namespace_b::StructInNestedNS>(&"foo_struct", Self::VT_FOO_STRUCT, false)?
+ .finish();
+ Ok(())
+ }
+}
pub struct TableInFirstNSArgs<'a> {
pub foo_table: Option<flatbuffers::WIPOffset<namespace_b::TableInNestedNS<'a>>>,
pub foo_enum: namespace_b::EnumInNestedNS,
@@ -170,10 +184,22 @@ impl<'a> SecondTableInA<'a> {
#[inline]
pub fn refer_to_c(&self) -> Option<super::namespace_c::TableInC<'a>> {
- self._tab.get::<flatbuffers::ForwardsUOffset<super::namespace_c::TableInC<'a>>>(SecondTableInA::VT_REFER_TO_C, None)
+ self._tab.get::<flatbuffers::ForwardsUOffset<super::namespace_c::TableInC>>(SecondTableInA::VT_REFER_TO_C, None)
}
}
+impl flatbuffers::Verifiable for SecondTableInA<'_> {
+ #[inline]
+ fn run_verifier<'o, 'b>(
+ v: &mut flatbuffers::Verifier<'o, 'b>, pos: usize
+ ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
+ use self::flatbuffers::Verifiable;
+ v.visit_table(pos)?
+ .visit_field::<flatbuffers::ForwardsUOffset<super::namespace_c::TableInC>>(&"refer_to_c", Self::VT_REFER_TO_C, false)?
+ .finish();
+ Ok(())
+ }
+}
pub struct SecondTableInAArgs<'a> {
pub refer_to_c: Option<flatbuffers::WIPOffset<super::namespace_c::TableInC<'a>>>,
}
@@ -269,14 +295,27 @@ impl<'a> TableInC<'a> {
#[inline]
pub fn refer_to_a1(&self) -> Option<super::namespace_a::TableInFirstNS<'a>> {
- self._tab.get::<flatbuffers::ForwardsUOffset<super::namespace_a::TableInFirstNS<'a>>>(TableInC::VT_REFER_TO_A1, None)
+ self._tab.get::<flatbuffers::ForwardsUOffset<super::namespace_a::TableInFirstNS>>(TableInC::VT_REFER_TO_A1, None)
}
#[inline]
pub fn refer_to_a2(&self) -> Option<super::namespace_a::SecondTableInA<'a>> {
- self._tab.get::<flatbuffers::ForwardsUOffset<super::namespace_a::SecondTableInA<'a>>>(TableInC::VT_REFER_TO_A2, None)
+ self._tab.get::<flatbuffers::ForwardsUOffset<super::namespace_a::SecondTableInA>>(TableInC::VT_REFER_TO_A2, None)
}
}
+impl flatbuffers::Verifiable for TableInC<'_> {
+ #[inline]
+ fn run_verifier<'o, 'b>(
+ v: &mut flatbuffers::Verifier<'o, 'b>, pos: usize
+ ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
+ use self::flatbuffers::Verifiable;
+ v.visit_table(pos)?
+ .visit_field::<flatbuffers::ForwardsUOffset<super::namespace_a::TableInFirstNS>>(&"refer_to_a1", Self::VT_REFER_TO_A1, false)?
+ .visit_field::<flatbuffers::ForwardsUOffset<super::namespace_a::SecondTableInA>>(&"refer_to_a2", Self::VT_REFER_TO_A2, false)?
+ .finish();
+ Ok(())
+ }
+}
pub struct TableInCArgs<'a> {
pub refer_to_a1: Option<flatbuffers::WIPOffset<super::namespace_a::TableInFirstNS<'a>>>,
pub refer_to_a2: Option<flatbuffers::WIPOffset<super::namespace_a::SecondTableInA<'a>>>,