Commit Graph

5 Commits

Author SHA1 Message Date
Casper 12e341e4f8
Rework how Rust generated files are laid out (#6731)
* Refactored Rust Generated code into a module directory.

Each symbol will be generated into one file and then
imported into a module. This breaks the "out_dir"
pattern where some users would generate code in their
target/ directory. Also, these objects are best used
in their own module. It will be hard for users to share
their own module structure with flatbuffers namespaces.

There may be solutions to these drawbacks but that should
be discussed. I don't want to overengineer here.

* shadow error

* try fix .bat file

* fix .bat 2

* Restore accidentally deleted files

* Fixed some DONOTSUBMITs and made Rust outdir pattern use symlinks.

* fixed binary files

* git clang format

* make generated onefiles not public and fix .bat

* reduced diff with master in generate_code.sh

* fix shadowed variable

* add object api flags to .bat

* space

* Removed extern crate and extra &

* use statement

* more clippy lints

* format

* Undo extern crate -> use change, it actually matters to our tests

Co-authored-by: Casper Neo <cneo@google.com>
2021-07-22 19:02:28 -04:00
Casper c24031c36b
Mark endian_scalar as unsafe. (#6588)
* Mark endian_scalar as unsafe.

Also
- removed the deprecated flexbuffer slice from example
- fixed some cargo warnings

* Assertions and read_scalar made unsafe

* Clippy lints

* Add to Safety

Co-authored-by: Casper Neo <cneo@google.com>
2021-04-26 09:18:58 -04:00
Casper 1da0a2dfac
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>
2021-01-22 13:07:32 -05:00
Casper 12ddc8a920
Rust Flexbuffers Documentation update (#5979)
* Update samples and docs

* Fixed a line of documentation

Co-authored-by: Casper Neo <cneo@google.com>
2020-06-18 00:01:48 -07:00
Casper 8be05f6bd4
Rust Flexbuffers (#5669)
* Cargo clippy lints

* more lints

* more lints

* Restored a doc comment

* Comment on float eps-eq and adjusted casting

* Rust Flexbuffers

* more serde tests, removed some unsafe

* Redid serde to be map-like and Reader is Display

* Moved iter from Reader to VectorReader

* Serious quickcheck + bugs

* wvo api

* Made types smaller for a reasonable speedup

* redid reading in a way that's a bit faster.

Profiling shows the rust slowdown as building +10%, reading +20%

* src/bin are developer binaries in rust

* Root and Map width are not packed

* key null check is debug only + doc changes

* BuilderOptions

* Documentation

* Documentation

* Moved tests to rust_usage_test

* Moved rust flexbuffers samples to Flatbuffers/samples

* Fixed RustTest

* Fixed for Rust 1.37.0

* Upgraded to rust 1_40_0

* fixed a little-endian-only feature in a test

* 1.40.0

* fixed some benchmarks for bigendian

* Updated .bat file

* misspelling

* Gold Flexbuffer test.

* Serialize,Deserialize, std::error::Error for Errors.

* Undo rustfmt in integration_test.rs

* from_slice instead of from_vec

* Added comments to unsafe blocks

* expanded on comment

* bump

Co-authored-by: CasperN <cneo@google.com>
2020-05-07 14:11:26 -07:00