cc-plus-pluscross-platformc-sharpflatbuffersgogrpcjavajavascriptjson-parsermarshallingmmapprotobufpythonrpcrustserializationserialization-librarystarred-google-repostarred-repotypescriptzero-copy
355dfd48d1
* Bugfix for Rust generation of union fields named with language keywords
Looking at ParseField, it appears that in the case of unions, an extra field with a `UnionTypeFieldSuffix` is added to the type definition, however, if the name of this field is a keyword in the target language, it isn't escaped.
For example, if generating code for rust for a union field named `type`, flatc will generate a (non-keyword escaped) field named `type_type` for this hidden union field, and one (keyword escaped) called `type_` for the actual union contents.
When the union accessors are generated, they refer to this `type_type` field, but they will escape it mistakenly, generating code like this:
```
#[inline]
#[allow(non_snake_case)]
pub fn type__as_int(&self) -> Option<Int<'a>> {
if self.type__type() == Type::Int {
self.type_().map(|u| Int::init_from_table(u))
} else {
None
}
}
```
Which will fail to build because the field is called `self.type_type()`, not `self.type__type()`.
* [Rust] Add crate-relative use statements for FBS includes.
At present if a flatbuffer description includes a reference to a type in
another file, the generated Rust code needs to be hand-modified to add
the appropriate `use` statements.
This assumes that the dependencies are built into the same crate, which
I think is a reasonable assumption?
* Revert "[Rust] Add crate-relative use statements for FBS includes."
This reverts commit
|
||
---|---|---|
.appveyor | ||
.bazelci | ||
.github | ||
.travis | ||
CMake | ||
android | ||
conan | ||
dart | ||
docs | ||
go | ||
grpc | ||
include/flatbuffers | ||
java/com/google/flatbuffers | ||
js | ||
lobster | ||
lua | ||
net/FlatBuffers | ||
php | ||
python | ||
reflection | ||
rust/flatbuffers | ||
samples | ||
snap | ||
src | ||
tests | ||
.clang-format | ||
.editorconfig | ||
.gitattributes | ||
.gitignore | ||
.travis.yml | ||
BUILD | ||
CMakeLists.txt | ||
CONTRIBUTING.md | ||
LICENSE.txt | ||
WORKSPACE | ||
appveyor.yml | ||
build_defs.bzl | ||
composer.json | ||
conanfile.py | ||
package.json | ||
pom.xml | ||
readme.md |
readme.md
FlatBuffers
FlatBuffers is a cross platform serialization library architected for maximum memory efficiency. It allows you to directly access serialized data without parsing/unpacking it first, while still having great forwards/backwards compatibility.
Go to our landing page to browse our documentation.
Supported operating systems
- Windows
- MacOS X
- Linux
- Android
- And any others with a recent C++ compiler.
Supported programming languages
- C++
- C#
- C
- Dart
- Go
- Java
- JavaScript
- Lobster
- Lua
- PHP
- Python
- Rust
- TypeScript
and more in progress...
Contribution
- FlatBuffers Google Group to discuss FlatBuffers with other developers and users.
- FlatBuffers Issues Tracker to submit an issue.
- stackoverflow.com with
flatbuffers
tag for any questions regarding FlatBuffers.
To contribute to this project, see CONTRIBUTING.
Licensing
Flatbuffers is licensed under the Apache License, Version 2.0. See LICENSE for the full license text.