uniffi-rs icon indicating copy to clipboard operation
uniffi-rs copied to clipboard

Reference to sequence of &str in UDL

Open iUnknwn opened this issue 1 year ago • 1 comments

I'm testing out uniffi for a project, and I'd like to expose a function that takes a list of strings to C#.

The function signature is:

pub fn take_names(names: &[&str]) -> String

However, I can't seem to declare a sequence of references. This doesn't build, failing with a UDL parse error:

string take_names([ByRef] sequence<[ByRef] string> names);

And removing the internal ByRef results in a compile error due to to the type mismatch.

Is there a recommendation for this?

I'm currently using uniffi v0.25 (unfortunately C# bindings do not work with more recent versions).

iUnknwn avatar Oct 12 '24 00:10 iUnknwn