Add EDL type <---> FlatBuffer type conversion for future rust support #149
+826
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why is this change needed?
This change introduces the foundation for Rust support in the EDL code generation toolchain.
It adds a procedural macro (
#[derive(EdlDerive)]
) and supporting crates that automatically generate conversionFrom
traits between developer-facing EDL types and their corresponding FlatBuffer types.What Changed?
New Crates
edlcodegen-core
—no_std
crate exposing theEdlDerive
macro used by EDL-generated types.edlcodegen-macros
— defines procedural macros that emitFrom
trait impls for structs and enums annotated with:#[target_struct(...)]
for struct mappings#[target_enum(...)]
for enum mappingsedlcodegen-tools
— build helper crate that downloads and exposes paths toedlcodegen.exe
andflatc.exe
for use in Rust build scripts. In the future this crate will be used by other crates to runedlcodegen.exe
on an edl file.edlcodegen-core-test
— test crate verifying round-trip conversions between EDL types and FlatBuffer-generated object API types.How was it tested?
cargo test -p edlcodegen-core-test
Next Steps
Future PRs will expand on this foundation to cover:
edlcodegen.exe
.