Skip to content
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

Support Result<T, E> as a return type from Rust -> C++ #404

Closed
4 tasks
ahayzen-kdab opened this issue Jan 9, 2023 · 0 comments
Closed
4 tasks

Support Result<T, E> as a return type from Rust -> C++ #404

ahayzen-kdab opened this issue Jan 9, 2023 · 0 comments
Assignees
Labels
🪲 bug Something isn't working

Comments

@ahayzen-kdab
Copy link
Collaborator

ahayzen-kdab commented Jan 9, 2023

https://cxx.rs/binding/result.html#returning-result-from-rust-to-c

We need to add support for returning a Result in invokables, this is tricky as the CXX and method types are different. Then Result is only supported in a return type and not a parameter (?).

Consider implementing the API ideas in dtolnay/cxx#1144 as part of this.

So

  • Have a separate cxx_utils module within cxx-qt-gen (which could then be made a crate)
  • Change the generator/cpp/types code into modular pieces
  • Move generator/rust/types into the same module
  • Add a separate method for when the type is a return type to support Result<T, E>
@ahayzen-kdab ahayzen-kdab added the 🪲 bug Something isn't working label Jan 9, 2023
@ahayzen-kdab ahayzen-kdab self-assigned this May 23, 2023
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue May 29, 2023
This allows us to have a separate module for independent helpers
for dealing with syn, CXX, and C++ together.

Related to KDAB#404
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Jun 22, 2023
This allows us to have a separate module for independent helpers
for dealing with syn, CXX, and C++ together.

Related to KDAB#404
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Jun 22, 2023
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Jun 22, 2023
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Jun 22, 2023
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Jun 22, 2023
This then avoids us needing to generate Rust methods with
fully qualified types on the Rust side and removes a load of
generation.

Related to KDAB#404
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Jun 22, 2023
This then avoids us needing to generate Rust methods with
fully qualified types on the Rust side and removes a load of
generation.

Related to KDAB#404
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Jun 22, 2023
This then avoids us needing to generate Rust methods with
fully qualified types on the Rust side and removes a load of
generation.

Related to KDAB#404
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Jul 4, 2023
This then avoids us needing to generate Rust methods with
fully qualified types on the Rust side and removes a load of
generation.

Related to KDAB#404
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Jul 4, 2023
This allows us to have a separate module for independent helpers
for dealing with syn, CXX, and C++ together.

Related to KDAB#404
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Jul 4, 2023
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Jul 4, 2023
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Jul 4, 2023
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Jul 4, 2023
This then avoids us needing to generate Rust methods with
fully qualified types on the Rust side and removes a load of
generation.

Related to KDAB#404
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Jul 18, 2023
This then avoids us needing to generate Rust methods with
fully qualified types on the Rust side and removes a load of
generation.

Related to KDAB#404
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Jul 19, 2023
This then avoids us needing to generate Rust methods with
fully qualified types on the Rust side and removes a load of
generation.

Related to KDAB#404
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Jul 19, 2023
This then avoids us needing to generate Rust methods with
fully qualified types on the Rust side and removes a load of
generation.

Related to KDAB#404
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Jul 19, 2023
This then avoids us needing to generate Rust methods with
fully qualified types on the Rust side and removes a load of
generation.

Related to KDAB#404
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Jul 19, 2023
This allows us to have a separate module for independent helpers
for dealing with syn, CXX, and C++ together.

Related to KDAB#404
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Jul 19, 2023
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Jul 19, 2023
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Jul 19, 2023
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Jul 19, 2023
This allows us to have a separate module for independent helpers
for dealing with syn, CXX, and C++ together.

Related to KDAB#404
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Jul 19, 2023
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Jul 24, 2023
This allows us later to be able to used qualified mappings.

Related to KDAB#404
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Jul 24, 2023
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Jul 24, 2023
This means that we refer to MyObject as ffi::MyObject when it's a type.

Related to KDAB#404
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Jul 24, 2023
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Jul 24, 2023
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Jul 24, 2023
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Jul 24, 2023
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Jul 24, 2023
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Jul 24, 2023
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Jul 24, 2023
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Jul 26, 2023
This allows us later to be able to used qualified mappings.

Related to KDAB#404
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Jul 26, 2023
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Jul 26, 2023
This means that we refer to MyObject as ffi::MyObject when it's a type.

Related to KDAB#404
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Jul 26, 2023
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Jul 26, 2023
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Jul 26, 2023
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Jul 26, 2023
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Jul 26, 2023
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Jul 26, 2023
ahayzen-kdab added a commit to ahayzen-kdab/cxx-qt that referenced this issue Jul 26, 2023
Be-ing pushed a commit that referenced this issue Jul 26, 2023
This allows us later to be able to used qualified mappings.

Related to #404
Be-ing pushed a commit that referenced this issue Jul 26, 2023
This means that we refer to MyObject as ffi::MyObject when it's a type.

Related to #404
Be-ing pushed a commit that referenced this issue Jul 26, 2023
Be-ing pushed a commit that referenced this issue Jul 26, 2023
Be-ing pushed a commit that referenced this issue Jul 26, 2023
Be-ing pushed a commit that referenced this issue Jul 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🪲 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant