Repository navigation
Add widestring support and improve Rust ABI parameter handling - #185
Merged
Merged
Conversation
Soham Das (SohamDas2021)
approved these changes
Jan 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 PR introduces initial widestring support and refines Rust ABI code generation to better align with FlatBuffers semantics and idiomatic Rust borrowing patterns.
What changed?
widestringas a workspace dependency and replaced the custom edl::WString wrapper withwidestring::U16String / U16Strthroughout generated Rust code.Option<&T>,Option<&mut T>, string slices for in parameters).assign_if_somehelper to safely propagate optionalout / inoutvalues from ABI results.Optional<T>Vec<T>vsslicesfor in parametersArraysStringandwstringhandlingABI WStringTandwidestring::U16String.&strinstead of&Stringfor string inputs andU16Strinstead of&edl::WStringfor wstring inputs.How was this tested?
Motivation
These changes:
[in]values rather than borrowing owned types when they won't be modifying them.[in]types in the past developers may have had to allocate an owned string (to_string()or vec type (to_vec) just to pass data to the codegen functions. Then in the codegen'd code we have to make a copy of them anyway when converting it to a flatbuffer type. Now we have one less allocation since the[in]will be a slice.[inout]and[out]parameters.