flutter_rust_bridge
flutter_rust_bridge copied to clipboard
Refactor Rust `wire2api`'s return type
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 akaAcc<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