Rust structz (#6539)

* Rust structz

* struct of structs test

* swift tmp variables

Co-authored-by: Casper Neo <cneo@google.com>
This commit is contained in:
Casper
2021-03-29 19:56:45 -04:00
committed by GitHub
parent 1c26d2a1a0
commit 4133a39df8
25 changed files with 1681 additions and 564 deletions

View File

@@ -110,8 +110,13 @@ impl<'a> flatbuffers::Verifiable for FromInclude {
impl flatbuffers::SimpleToVerifyInSlice for FromInclude {}
// struct Unused, aligned to 4
#[repr(transparent)]
#[derive(Clone, Copy, PartialEq, Default)]
#[derive(Clone, Copy, PartialEq)]
pub struct Unused(pub [u8; 4]);
impl Default for Unused {
fn default() -> Self {
Self([0; 4])
}
}
impl std::fmt::Debug for Unused {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("Unused")