mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-28 04:48:05 +00:00
Rust full reflection (#8102)
* #Rust Create a crate for reflection * #Rust Add a crate for reflection tests and helper to access schema * #Rust Get root table of a buffer and access field with schema * #Rust Add 'Struct' struct and corresponding getter * #Rust Add functions of getting any table/struct field value as integer/float/string * #Rust Add setters for scalar fields * #Rust Add setter for string fields * #Rust Add getter for Table/Vector fields * #Rust Add buffer verification * Add a 'SafeBuffer' struct which provides safe methods for reflection It verifies buffer against schema during construction and provides all the unsafe getters in lib.rs in a safe way --------- Co-authored-by: Derek Bailey <derekbailey@google.com>
This commit is contained in:
2
tests/rust_reflection_test/.gitignore
vendored
Normal file
2
tests/rust_reflection_test/.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
/target
|
||||
Cargo.lock
|
||||
9
tests/rust_reflection_test/Cargo.toml
Normal file
9
tests/rust_reflection_test/Cargo.toml
Normal file
@@ -0,0 +1,9 @@
|
||||
[package]
|
||||
name = "rust_reflection_test"
|
||||
version = "0.1.0"
|
||||
edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
flatbuffers-reflection = { path = "../../rust/reflection" }
|
||||
flatbuffers = { path = "../../rust/flatbuffers" }
|
||||
assert_approx_eq = "1.1.0"
|
||||
2136
tests/rust_reflection_test/src/lib.rs
Normal file
2136
tests/rust_reflection_test/src/lib.rs
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user