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

Add support for recursive enums

Open rfk opened this issue 4 years ago • 2 comments

In https://github.com/mozilla/uniffi-rs/pull/381 we added support for enums with associated data, but it doesn't properly support recursive enums, like the classic "tree" example where the enum variants are Tree::Leaf and Tree::Branch(left: Tree, right: Tree). Some notes on what we'd need in order to support such:

  • In the rust code, we'll need to be prepared to Box the values in the recursive fields.
  • In the swift binding, we'll need to use indirect keyword to support recursive enums.

┆Issue is synchronized with this Jira Task ┆Issue Number: UNIFFI-49

rfk avatar Feb 19 '21 04:02 rfk

Still necessary :-). Any idea if we are close to get something, or should I try?

Hywan avatar Feb 05 '24 13:02 Hywan

I've not heard of anyone with plans to do this soon.

mhammond avatar Feb 05 '24 14:02 mhammond