flutter_rust_bridge icon indicating copy to clipboard operation
flutter_rust_bridge copied to clipboard

Refactor Rust `wire2api`'s return type

Open Desdaemon opened this issue 3 years ago • 0 comments

I'm rethinking this and I don't think closures are a good long-term solution, due to the fact that Acc<Option<String>> is used as the return type of a trait method. Aside from the additional complexity, we would have to resort to dynamic dispatch aka Acc<Option<&dyn Fn() -> String>> which would cause more trouble than it solves. We can revisit this logic in the future, when we have a clearer picture of the common patterns between the impls.

Originally posted by @Desdaemon in https://github.com/fzyzcjy/flutter_rust_bridge/pull/589#discussion_r962427281

Desdaemon avatar Sep 06 '22 16:09 Desdaemon