uniffi-rs
uniffi-rs copied to clipboard
Support for `Option<&T>`
According to the documentation(source), Option<&T>
is supported by proc macro:
#[uniffi::export]
fn process_data(a: &MyRecord, b: &MyEnum, c: Option<&MyRecord>) {}
However, this seems to result in the following error:
| fn process_data(_a: &MyRecord, _b: &MyEnum, _c: Option<&MyRecord>) {}
| ^^^^^^^^^^^^^^^^^ the trait `uniffi::TypeId<UniFfiTag>` is not implemented for `&MyRecord`, which is required by `Option<&MyRecord>: uniffi::TypeId<UniFfiTag>`
Here is a demo project that demonstrates this. Hopefully I am missing something, but if not, would it be possible to add support for this?
The alternative at the moment is to use &Option<T>
, but that has completely different semantics to Option<&T>
.