-
Notifications
You must be signed in to change notification settings - Fork 36
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
Get function pointer from high-level FnPtrX
#35
Comments
That's reasonable but the high-level API is really nice for minimal boilerplate passing of a Rust closure as a callback to a C API. It does indeed require some careful lifetime management to make sure things passed to C are scoped correctly and exist for the right lifetimes, but a sprinkling of Overall I'm a huge fan of the magic the |
To answer the question:
It is valid to both transmute a Edit: Please read issue #34 if you're planning on using the |
@Monadic-Cat Any chance you could provide an example? I'm unable to figure out how to convert your advice into code... Edit: |
The soundness fixes of #27 are great, but now I don't see an obvious means of passing the
FnPtrX
struct across a C API as anextern "C" fn
pointer directly as before. Thefunc
member is private so what would the correct means of getting that pointer be?The text was updated successfully, but these errors were encountered: