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

impl Blocks and Static Methods #1102

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

maurer
Copy link

@maurer maurer commented Sep 27, 2022

Adds support for using extern impl blocks to describe methods and static/associated functions on a type.

Requires a companion patch to rustc, so this may take some time to be able to land.

This syntax allows methods in the bridge block to be grouped together by
type and use implicitly typed receivers (e.g. `&self`, `&mut self`, or
`self`) even when multiple types are declared in the same bridge.
Support binding to static methods (C++) and associated methods (Rust) by
using `impl` blocks to indicate which type it belongs to.
@maurer
Copy link
Author

maurer commented Sep 27, 2022

See rust-lang/rust#102376 for the companion PR to rustc to make this possible.

@ahayzen-kdab
Copy link
Contributor

Note that there are discussions around possible static methods API here #447, although it's not clear if there was a preferred API.

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.

2 participants