Closed rogurotus closed 1 year ago
IMHO it should be possible to use struct/enum in sync return as well. What error does it generate when doing so?
In general, I understood this works when the implementation is already there, but if you are generating for the first time then the error is caught before the code is generated
error like this
pub struct SyncReturn<T: IntoDart>(pub T);
| ^^^^^^^^ required by this bound in `flutter_rust_bridge::SyncReturn`
In theory, we can remove the restriction from struct SyncReturn since there is already an IntoDart restriction in the generated code
Feel free to PR! (and let's see how CI says - if CI is happy then IMHO this should be ok)
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new issue.
SyncReturn
has been recently redesigned (thanks @ngasull for the great implementation) judging by the implementation, it became possible to use SyncReturn(Struct) SyncReturn(Enum), but for some reason I do not understand, this is restricted.The restriction is imposed here. frb_rust/src/lib.rs
although frb generates
IntoDart
and if you do pub structSyncReturn<T>(pub T);
in SyncReturn it will be possible to use structure