Rust Object API (#6070)

* inital commit of rust object api

* Required fields support.

* clang fallthrough

* Fix unused variables

* just don't fall through

* remove comment

* s/panic/unreachable

* Tests for object API

* Added defaults

* deleted unintentionally added files and updated .bat file

* fix bat file

* clang format

* Cargo clippy checks

* remove commented out code

* clippy allows

* Remove matches! macro since we're not yet at Rust v1.42

* install clippy in RustTest.sh

* move line

Co-authored-by: Casper Neo <cneo@google.com>
This commit is contained in:
Casper
2021-01-22 13:07:32 -05:00
committed by GitHub
parent 796ed68faf
commit 1da0a2dfac
21 changed files with 2362 additions and 319 deletions

View File

@@ -39,7 +39,7 @@ pub const ENUM_VALUES_FROM_INCLUDE: [FromInclude; 1] = [
FromInclude::IncludeVal,
];
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
pub struct FromInclude(pub i64);
#[allow(non_upper_case_globals)]
@@ -111,7 +111,7 @@ impl<'a> flatbuffers::Verifiable for FromInclude {
impl flatbuffers::SimpleToVerifyInSlice for FromInclude {}
// struct Unused, aligned to 4
#[repr(transparent)]
#[derive(Clone, Copy, PartialEq)]
#[derive(Clone, Copy, PartialEq, Default)]
pub struct Unused(pub [u8; 4]);
impl std::fmt::Debug for Unused {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
@@ -221,9 +221,7 @@ impl<'a> flatbuffers::Follow<'a> for TableB<'a> {
impl<'a> TableB<'a> {
#[inline]
pub fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
TableB {
_tab: table,
}
TableB { _tab: table }
}
#[allow(unused_mut)]
pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>(