Coder Social home page Coder Social logo

Comments (6)

giarc3 avatar giarc3 commented on September 28, 2024 1

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.

mhammond avatar mhammond commented on September 28, 2024

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.

mhammond avatar mhammond commented on September 28, 2024

(alternatively, I think we could arrange to generate an async fn there, which, IIUC, would be happy with -> "int")

from uniffi-rs.

giarc3 avatar giarc3 commented on September 28, 2024

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.

mhammond avatar mhammond commented on September 28, 2024

I thought changing to async will also require the final return to be "return await" or similar?

from uniffi-rs.

giarc3 avatar giarc3 commented on September 28, 2024

Completed by #1984

from uniffi-rs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.