Skip to content

added abi stable equivalents of closure traits#95

Open
p-avital wants to merge 2 commits intorodrimati1992:masterfrom
p-avital:closures
Open

added abi stable equivalents of closure traits#95
p-avital wants to merge 2 commits intorodrimati1992:masterfrom
p-avital:closures

Conversation

@p-avital
Copy link
Copy Markdown

@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
Copy Markdown
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