Skip to content

Conversation

@chavic
Copy link
Contributor

@chavic chavic commented Nov 27, 2025

Finally taught the Dart bindings how to handle async functions. The runtime now keeps a handle map for Rust futures and foreign (Dart) futures; we generate static factory methods for async constructors, and callback interfaces can actually await their Dart implementations. I also cleaned up the dart_async fixture tests so they call those factories instead of pretending constructors can be async. This should address #66

Summary

  • overhaul uniffiRustCallAsync and add shared UniffiForeignFuture runtime glue (handle map, cancellation)
  • generate async factories for object constructors and route async free functions through the new helper
  • teach callback codegen to emit foreign future structs/typedefs and drive async Dart callbacks safely
  • update dart_async fixture/tests to call the async factories (Megaphone.new_(), UdlMegaphone.new_(), etc.) and adjust timing expectations

Testing

cargo test -p dart_async

@chavic chavic self-assigned this Nov 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant