New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for async functions returning opaque Rust types #120
Comments
Yup, having async functions return opaque Rust types is not yet supported.
We'd first want to add an integration test, similar to the one for returning returning a transparent struct from an async function.
swift-bridge/crates/swift-integration-tests/src/async_function.rs Lines 32 to 34 in dc1119e
swift-bridge/SwiftRustIntegrationTestRunner/SwiftRustIntegrationTestRunnerTests/AsyncTests.swift Lines 44 to 46 in dc1119e
Next we'd add a codegen test for returning an opaque Rust type from an async function. Similar to: swift-bridge/crates/swift-bridge-ir/src/codegen/codegen_tests/async_function_codegen_tests.rs Lines 357 to 424 in dc1119e
Then we'd get the codegen tests passing. In this case this would boil down to tweaking code in
After that we would verify that the integration test was passing by running I just added some basic documentation on adding support for types / function signatures: https://chinedufn.github.io/swift-bridge/contributing/adding-support-for-a-signature/index.html
That should work, but we haven't yet added explicit tests for swift-bridge/crates/swift-integration-tests/src/shared_types/shared_struct.rs Lines 12 to 15 in b744328
... but... it should work since the code for bridging struct primitive struct fields hits the same code paths as bridging any other type.. |
This was implemented in c4a11f4 |
I've got a quite complicated type I'm sharing via the swift bridge interface. I'm using an opaque type, but I want to use the async function bridge and it looks like thats not supported:
The code for async functions in opaque types is unimplemented:
The text was updated successfully, but these errors were encountered: