Skip to content

Add attribute which generates wrappers for a function#1278

Merged
BenFordTytherington merged 2 commits into
KDAB:mainfrom
BenFordTytherington:wrapper-shorthand
Oct 3, 2025
Merged

Add attribute which generates wrappers for a function#1278
BenFordTytherington merged 2 commits into
KDAB:mainfrom
BenFordTytherington:wrapper-shorthand

Conversation

@BenFordTytherington

@BenFordTytherington BenFordTytherington commented May 20, 2025

Copy link
Copy Markdown
Collaborator

Closes #1235

Adds the auto_wrap attribute which will generate the wrapper function for methods defined in the bridge.

@codecov

codecov Bot commented May 20, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (0fba618) to head (8826137).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##              main     #1278    +/-   ##
==========================================
  Coverage   100.00%   100.00%            
==========================================
  Files           75        75            
  Lines        12927     13051   +124     
==========================================
+ Hits         12927     13051   +124     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread crates/cxx-qt-gen/test_outputs/passthrough_and_naming.rs Outdated
@BenFordTytherington
BenFordTytherington force-pushed the wrapper-shorthand branch 2 times, most recently from a6b282c to 4619a1b Compare September 17, 2025 11:24
Comment thread crates/cxx-qt-gen/test_outputs/passthrough_and_naming.rs Outdated
Comment thread crates/cxx-qt-gen/src/generator/rust/method.rs Outdated
Comment thread crates/cxx-qt-gen/src/generator/rust/method.rs Outdated
Comment thread book/src/bridge/attributes.md
@BenFordTytherington
BenFordTytherington force-pushed the wrapper-shorthand branch 2 times, most recently from bf40f52 to b30fe57 Compare September 17, 2025 15:31
Comment thread crates/cxx-qt-gen/src/generator/rust/method.rs Outdated
Comment thread crates/cxx-qt-gen/src/generator/rust/method.rs Outdated
Comment thread crates/cxx-qt-gen/test_outputs/passthrough_and_naming.rs Outdated
@BenFordTytherington
BenFordTytherington force-pushed the wrapper-shorthand branch 4 times, most recently from 72daf64 to 4ba0f8b Compare September 25, 2025 11:26
Comment thread crates/cxx-qt-gen/src/generator/rust/mod.rs Outdated
Comment thread crates/cxx-qt-gen/src/generator/rust/method.rs Outdated
@BenFordTytherington
BenFordTytherington force-pushed the wrapper-shorthand branch 4 times, most recently from 899b1b1 to e12132c Compare September 26, 2025 14:53

@LeonMatthesKDAB LeonMatthesKDAB left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some nitpicks left, otherwise okay from my side.

Comment thread crates/cxx-qt-gen/src/generator/rust/method.rs Outdated
Comment thread crates/cxx-qt-gen/test_inputs/passthrough_and_naming.rs
Comment thread crates/cxx-qt-gen/src/generator/rust/method.rs Outdated
@BenFordTytherington
BenFordTytherington force-pushed the wrapper-shorthand branch 3 times, most recently from 904910f to 7b53406 Compare September 29, 2025 10:43
ahayzen-kdab
ahayzen-kdab previously approved these changes Oct 1, 2025

@ahayzen-kdab ahayzen-kdab left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good and a nice shorthand :-)

LeonMatthesKDAB
LeonMatthesKDAB previously approved these changes Oct 2, 2025
- Updates tests
- Adds necessary import to impl block
- Extract wrapper generation to function
- Update book

@ahayzen-kdab ahayzen-kdab left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good and the rebase sorted the commits chain out :-)

@BenFordTytherington
BenFordTytherington added this pull request to the merge queue Oct 3, 2025
Merged via the queue into KDAB:main with commit ef8a3c9 Oct 3, 2025
16 checks passed
@BenFordTytherington
BenFordTytherington deleted the wrapper-shorthand branch October 3, 2025 13:15
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.

Shorthand to directly wrap functions on the inner Rust struct

3 participants