[Rust] Add support for fixed size arrays (#6548)

* Add support for fixed size arrays

* clang-format

* Update rust image to 1.51 to support const generics

* Handle correctly big endian

* Add fuzz tests and clean code

* Add struct fuzz test and optimize struct arrays for api

* Bump flatbuffers crate version
This commit is contained in:
Eddie Linder
2021-04-16 18:15:59 +03:00
committed by GitHub
parent 151900ba96
commit da3bb64ef6
25 changed files with 1442 additions and 77 deletions

View File

@@ -39,8 +39,10 @@ pub enum InvalidFlatbuffer {
required: &'static str,
error_trace: ErrorTrace,
},
#[error("Union exactly one of union discriminant (`{field_type}`) and value \
(`{field}`) are present.\n{error_trace}")]
#[error(
"Union exactly one of union discriminant (`{field_type}`) and value \
(`{field}`) are present.\n{error_trace}"
)]
InconsistentUnion {
field: &'static str,
field_type: &'static str,
@@ -70,8 +72,10 @@ pub enum InvalidFlatbuffer {
range: Range<usize>,
error_trace: ErrorTrace,
},
#[error("Signed offset at position {position} has value {soffset} which points out of bounds.\
\n{error_trace}")]
#[error(
"Signed offset at position {position} has value {soffset} which points out of bounds.\
\n{error_trace}"
)]
SignedOffsetOutOfBounds {
soffset: SOffsetT,
position: usize,