This PR implements the conversion logic on the C# side for passing lists of values to Rust functions. Most of the functionality on the Rust side was already in place, the only addition was that we now export functions for taking a &[T::Abi] and converting it into a Vec<T>. This allows the C# side to "allocate" a Rust Vec when one is expected by an exported Rust function (or inside the raw representation of a type being passed to an exported function) while avoiding the tricky questions that arise if we try to pass a RawVec that wasn't allocated on the Rust side. The main drawback to this approach is that it means an extra call into Rust for each Vec that needs to be created, though we don't yet know how expense the cross-language calls are yet.
This PR implements the conversion logic on the C# side for passing lists of values to Rust functions. Most of the functionality on the Rust side was already in place, the only addition was that we now export functions for taking a
&[T::Abi]
and converting it into aVec<T>
. This allows the C# side to "allocate" a RustVec
when one is expected by an exported Rust function (or inside the raw representation of a type being passed to an exported function) while avoiding the tricky questions that arise if we try to pass aRawVec
that wasn't allocated on the Rust side. The main drawback to this approach is that it means an extra call into Rust for eachVec
that needs to be created, though we don't yet know how expense the cross-language calls are yet.