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

added abi stable equivalents of closure traits #95

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

Conversation

p-avital
Copy link

@p-avital p-avital commented Sep 5, 2022

Hiya,

Here's an proposal for some abi-stable equivalents of the Fn traits, to allow passing closures over the FFI boundary easily.

I'm planning on proposing something similar for std::future::Future soon (working on the Waker at the moment).

Let me know if you'd like to see some changes. Note that I only handled the single argument case, under the judgement call that if you want to pass multiple parameters to a closure over FFI, you might want to make sure the layout of the passed value suits you.

@ahmed-masud
Copy link
Contributor

Not sure if you are going to apply this patch, but I am planning on using it in production (I'll end up putting it in an extras crate that I've created) would you be interested in the results?

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