This PR adds support for more return types for function exports via #[rid::export].
It contains some WIP for HashMap support as well. While working on that I realized that in order to send the keys() as a Vec it needs to be supported first.
Supported Types
I added lots of tests which verify that the following export return types are now supported:
In the case of vecs with a string-like type the string value is not resolved until the item in the Vec is accessed in order to push out copying the data to convert to a *const char until the last possible moment.
Summary
This PR adds support for more return types for function exports via
#[rid::export]
. It contains some WIP for HashMap support as well. While working on that I realized that in order to send thekeys()
as aVec
it needs to be supported first.Supported Types
I added lots of tests which verify that the following export return types are now supported:
Vecs
In the case of vecs with a string-like type the string value is not resolved until the item in the Vec is accessed in order to push out copying the data to convert to a
*const char
until the last possible moment.Primitives
Strings
They are sent as
*const char
to Dart.C-Style Enums
Enums are converted to
i8
when sent to Dart and serialized back into an enum on the Dart end.Commits
Vec<&String|&CString>