Comments (6)
You're correct, that's also necessary. The return statement it generated for me is a call to _uniffi_rust_call_async
, so it should change to return await _uniffi_rust_call_async
from uniffi-rs.
Sadly we don't have many tests here so I'm not easily able to verify what the correct thing to generate is - I think it should generate -> "Awaitable[int]"
- is that correct? Can you verify by hand-editing the generated .py that does what you expect?
from uniffi-rs.
(alternatively, I think we could arrange to generate an async
fn there, which, IIUC, would be happy with -> "int"
)
from uniffi-rs.
I believe that adding async
and indicating the return type as normal is the correct thing to do here. I hand-edited the generated code and confirmed that it matched my expectation when calling the function
from uniffi-rs.
I thought changing to async will also require the final return to be "return await" or similar?
from uniffi-rs.
Completed by #1984
from uniffi-rs.
Related Issues (20)
- Use the `FfiValue` type for all arguments HOT 1
- `HandleAlloc::clone_handle` and `consume_handle` should be marked unsafe HOT 3
- Rust pointers can have both even and odd addresses HOT 4
- `RustCallStatus::error_buf` should be `ManuallyDrop`, not `MaybeUninit`?
- Add implemented traits to generated code, or add extension? HOT 2
- [Swift] Would it be possible to use checked exceptions? HOT 6
- Only invoke cargo metadata for desired targets HOT 7
- Add a conversion pass before rendering the bindings templates HOT 3
- How to get Rust panic backtrace?
- Swift classes are not generated properly with their Protocol as Generic Type HOT 2
- Interface/Protocol use in foreign generated code HOT 4
- FR: Optionally disable exception catching in foreign trait code
- Tell the bindings about traits implemented by objects.
- Allow trait interfaces without a Send + Sync bound
- Undefined features `log_panics` and `log_backtraces` HOT 1
- How to implement builder pattern using uniffi? HOT 6
- Uniffi ForeignFuture inconsistenty dropped HOT 10
- Add tracing to FFI calls
- Make it possible to rename structs HOT 9
- ld: building for 'macOS', but linking in object file built for 'iOS' HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from uniffi-rs.